diff options
| author | kutayboz <kutayboz@gmail.com> | 2023-08-03 17:44:37 +0300 |
|---|---|---|
| committer | kutayboz <kutayboz@gmail.com> | 2023-08-03 17:44:37 +0300 |
| commit | 5d48f1280612b2f525c9a2d60f96434f1a217156 (patch) | |
| tree | 24443e33c6feb0dd581577efece1a278cc2549d0 /include/utils.h | |
| parent | cd38d7c7d4710159b86ca5ed1557b46bba41d2ca (diff) | |
| download | celnetmon-5d48f1280612b2f525c9a2d60f96434f1a217156.tar.gz | |
Finished cfg file implementation. Preliminary readme. v1.0.0v1.0.0
Diffstat (limited to 'include/utils.h')
| -rw-r--r-- | include/utils.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/utils.h b/include/utils.h index 06c48e6..2a32a54 100644 --- a/include/utils.h +++ b/include/utils.h @@ -5,14 +5,26 @@ enum { /* Mandatory */ PATH_TO_SERIAL_PORT_POS, PATH_TO_GPIO_CHIP_POS, + MQTT_URL_POS, + NETWORK_APN_POS, /* Optional */ + MQTT_USERNAME_POS, + MQTT_PASSWORD_POS, + MQTT_ROOT_TOPIC_POS, NETWORK_USERNAME_POS, NETWORK_PASSWORD_POS, NETWORK_AUTH_POS, STR_LIST_LENGTH }; -enum { PIN_PWR_KEY_POS, PIN_STATUS_POS, INT_LIST_LENGTH }; +enum { /*Mandatory */ + PIN_PWR_KEY_POS, + PIN_STATUS_POS, + MQTT_PORT_POS, + /* Optional */ + NETWORK_OPERATOR_POS, + INT_LIST_LENGTH +}; typedef struct { char *name; @@ -24,6 +36,7 @@ typedef struct { int value; } intData; +/* Initialize this with NULL and 0 values. */ typedef struct { strData *strDataList; intData *intDataList; @@ -41,8 +54,8 @@ network_username = "something something" network_password = "something something" network_auth = "something something" */ -int readCfg(listCfgData dataCfg, const char *pathExe); +int readCfg(listCfgData *cfgData, const char *pathExe); -int freeCfgData(listCfgData cfgData); +int freeCfgData(listCfgData *cfgData); #endif |
