summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2022-05-05 17:49:11 -0500
committerHarsh Sharma <harsh.sharma@multitech.com>2022-05-05 17:49:11 -0500
commitf6c2760fa5c4c27014454014d38dffe361a24bac (patch)
tree34821fc3d92281956ec5245b6df6d78b1dca7091
parent3b7195f39bb90e269e008adf2736441943ee7f63 (diff)
downloadlora_gateway_mtac_full-f6c2760fa5c4c27014454014d38dffe361a24bac.tar.gz
lora_gateway_mtac_full-f6c2760fa5c4c27014454014d38dffe361a24bac.tar.bz2
lora_gateway_mtac_full-f6c2760fa5c4c27014454014d38dffe361a24bac.zip
Bug fixes: gps disable should be void, all gps stream invalid results should reset the loop5.0.14
-rw-r--r--libloragw/inc/loragw_gps.h3
-rw-r--r--libloragw/src/loragw_gps.c2
-rw-r--r--libloragw/tst/test_loragw_gps.c10
3 files changed, 5 insertions, 10 deletions
diff --git a/libloragw/inc/loragw_gps.h b/libloragw/inc/loragw_gps.h
index 9e3aa27..606bd15 100644
--- a/libloragw/inc/loragw_gps.h
+++ b/libloragw/inc/loragw_gps.h
@@ -115,9 +115,8 @@ int lgw_gps_enable();
/**
@brief Disable GPSD
-@return success if the function was able to disable the gpsd connection
*/
-int lgw_gps_disable();
+void lgw_gps_disable();
/**
@brief Prepare for a blocking read
diff --git a/libloragw/src/loragw_gps.c b/libloragw/src/loragw_gps.c
index e13b85b..736626d 100644
--- a/libloragw/src/loragw_gps.c
+++ b/libloragw/src/loragw_gps.c
@@ -280,7 +280,7 @@ int lgw_gps_enable() {
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-int lgw_gps_disable() {
+void lgw_gps_disable() {
(void)gps_close(&gpsdata);
}
diff --git a/libloragw/tst/test_loragw_gps.c b/libloragw/tst/test_loragw_gps.c
index 05ec53c..6efd351 100644
--- a/libloragw/tst/test_loragw_gps.c
+++ b/libloragw/tst/test_loragw_gps.c
@@ -202,12 +202,8 @@ int main()
switch (state) {
case GPS_LOST: {
- i = lgw_gps_disable();
- if (i == LGW_HAL_SUCCESS) {
- printf("INFO: GPS closed successfully\n");
- } else {
- printf("WARNING: failed to close GPS successfully\n");
- }
+ lgw_gps_disable();
+ printf("INFO: GPS closed\n");
empty_packet_count = 0;
read_fail_count = 0;
state = GPS_RECONNECTING;
@@ -245,8 +241,8 @@ int main()
read_fail_count++;
if (read_fail_count > 9) {
state = GPS_LOST;
- continue;
}
+ continue;
}
break;
}