aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-12-17 18:08:52 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-12-17 18:28:57 +0100
commit9492551e779f131acbcb36b978df9840efa7777c (patch)
tree5fe522680cbb205d744c6085e0c048acac311cfd /src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
parent21a8fb53af19c77c481e1aa31442390600eaa19c (diff)
sysmobts_mgr: Prepare code for gpsd < 2.96 support
API prior to that version allocates the pointer internally. Let's change current code to always use a pointer and in current supported code (gpsd >= 2.96) point it to a user-allocated struct. Follow-up patch will introduce necessary ifdefs to support older gpsd. Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f
Diffstat (limited to 'src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c')
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
index b0b5edd8..ec8cb93a 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
@@ -86,14 +86,14 @@ static void mgr_gps_close(struct sysmobts_mgr_instance *mgr)
osmo_timer_del(&mgr->calib.fix_timeout);
osmo_fd_unregister(&mgr->calib.gpsfd);
- gps_close(&mgr->calib.gpsdata);
- memset(&mgr->calib.gpsdata, 0, sizeof(mgr->calib.gpsdata));
+ gps_close(mgr->calib.gpsdata);
+ memset(mgr->calib.gpsdata, 0, sizeof(*(mgr->calib.gpsdata)));
mgr->calib.gps_open = 0;
}
static void mgr_gps_checkfix(struct sysmobts_mgr_instance *mgr)
{
- struct gps_data_t *data = &mgr->calib.gpsdata;
+ struct gps_data_t *data = mgr->calib.gpsdata;
/* No 2D fix yet */
if (data->fix.mode < MODE_2D) {
@@ -119,7 +119,7 @@ static int mgr_gps_read(struct osmo_fd *fd, unsigned int what)
{
int rc;
struct sysmobts_mgr_instance *mgr = fd->data;
- rc = compat_gps_read(&mgr->calib.gpsdata);
+ rc = compat_gps_read(mgr->calib.gpsdata);
if (rc == -1) {
LOGP(DCALIB, LOGL_ERROR, "gpsd vanished during read.\n");
calib_state_reset(mgr, CALIB_FAIL_GPS);
@@ -143,7 +143,7 @@ static void mgr_gps_open(struct sysmobts_mgr_instance *mgr)
{
int rc;
- rc = gps_open("localhost", DEFAULT_GPSD_PORT, &mgr->calib.gpsdata);
+ rc = gps_open("localhost", DEFAULT_GPSD_PORT, mgr->calib.gpsdata);
if (rc != 0) {
LOGP(DCALIB, LOGL_ERROR, "Failed to connect to GPS %d\n", rc);
calib_state_reset(mgr, CALIB_FAIL_GPS);
@@ -151,12 +151,12 @@ static void mgr_gps_open(struct sysmobts_mgr_instance *mgr)
}
mgr->calib.gps_open = 1;
- gps_stream(&mgr->calib.gpsdata, WATCH_ENABLE, NULL);
+ gps_stream(mgr->calib.gpsdata, WATCH_ENABLE, NULL);
mgr->calib.gpsfd.data = mgr;
mgr->calib.gpsfd.cb = mgr_gps_read;
mgr->calib.gpsfd.when = BSC_FD_READ | BSC_FD_EXCEPT;
- mgr->calib.gpsfd.fd = mgr->calib.gpsdata.gps_fd;
+ mgr->calib.gpsfd.fd = mgr->calib.gpsdata->gps_fd;
if (osmo_fd_register(&mgr->calib.gpsfd) < 0) {
LOGP(DCALIB, LOGL_ERROR, "Failed to register GPSD fd\n");
calib_state_reset(mgr, CALIB_FAIL_GPS);