summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorkutayboz <kutayboz@gmail.com>2023-06-12 04:13:15 +0300
committerkutayboz <kutayboz@gmail.com>2023-06-12 04:13:15 +0300
commit4b05dfa98dd8cdf1be89a28d128ace6490b403c0 (patch)
tree9587ddbb8cf33b090128160eea6e0201ed71bee9 /include
parent15b34952c44f19e6e31d81096c6ee43b6f1a201d (diff)
downloadcelnetmon-4b05dfa98dd8cdf1be89a28d128ace6490b403c0.tar.gz
Implementing data gathering function
Diffstat (limited to 'include')
-rw-r--r--include/bg96.h18
-rw-r--r--include/serial.h6
2 files changed, 20 insertions, 4 deletions
diff --git a/include/bg96.h b/include/bg96.h
index b304479..d6715f3 100644
--- a/include/bg96.h
+++ b/include/bg96.h
@@ -1,6 +1,20 @@
#ifndef __INCLUDE_BG96__
#define __INCLUDE_BG96__
+struct networkData {
+ char *operatorName;
+ char *currentTech;
+ char *networkRegStat;
+ char *trkAreaCode;
+ char *cellID;
+ char *rssi;
+ char *ber;
+};
+
+int initNetworkData(struct networkData *nD);
+
+int freeNetworkData(struct networkData *nD);
+
int powerOn(char *pathToPort, char *pathToChip, int statusPin, int pwrKeyPin);
int powerOff(char *pathToPort, char *pathToChip, int statusPin, int pwrKeyPin);
@@ -14,4 +28,8 @@ int mqttDisc(char *pathToPort);
int mqttConn(char *pathToPort, char *hostURL, int hostPort, char *username,
char *password);
+int mqttPub(char *pathToPort, char *topic, char *msg);
+
+int gatherData(struct networkData *output, char *pathToPort);
+
#endif
diff --git a/include/serial.h b/include/serial.h
index 033fd54..5099ee7 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -1,11 +1,9 @@
#ifndef __INCLUDE_SERIAL__
#define __INCLUDE_SERIAL__
-typedef enum { SUCCESS, ERROR_READ, ERROR_TIMEOUT } SERIAL_RETURN_CODE;
-
int openSerialPort(char pathToPort[]);
-SERIAL_RETURN_CODE querySerialPort(char **output, int serialPort, char *input,
- int timeoutSeconds, char *lastLineSubStr);
+int querySerialPort(char **output, int serialPort, char *input,
+ int timeoutSeconds, char *lastLineSubStr);
#endif