diff options
Diffstat (limited to 'src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c')
-rw-r--r-- | src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c index 3ddf0e8c..cf904aea 100644 --- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c +++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c @@ -17,7 +17,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. @@ -171,7 +171,12 @@ static void mgr_gps_checkfix(struct oc2gbts_mgr_instance *mgr) return; } +#if GPSD_API_MAJOR_VERSION >= 9 + mgr->gps.gps_fix_now = data->fix.time.tv_sec; +#else mgr->gps.gps_fix_now = (time_t) data->fix.time; +#endif + LOGP(DCALIB, LOGL_INFO, "Got a GPS fix, satellites used: %d, timestamp: %ld\n", data->satellites_used, mgr->gps.gps_fix_now); osmo_timer_del(&mgr->gps.fix_timeout); @@ -220,10 +225,8 @@ static void mgr_gps_open(struct oc2gbts_mgr_instance *mgr) mgr->gps.gps_open = 1; gps_stream(&mgr->gps.gpsdata, WATCH_ENABLE, NULL); - mgr->gps.gpsfd.data = mgr; - mgr->gps.gpsfd.cb = mgr_gps_read; - mgr->gps.gpsfd.when = BSC_FD_READ | BSC_FD_EXCEPT; - mgr->gps.gpsfd.fd = mgr->gps.gpsdata.gps_fd; + osmo_fd_setup(&mgr->gps.gpsfd, mgr->gps.gpsdata.gps_fd, OSMO_FD_READ | OSMO_FD_EXCEPT, + mgr_gps_read, mgr, 0); if (osmo_fd_register(&mgr->gps.gpsfd) < 0) { LOGP(DCALIB, LOGL_ERROR, "Failed to register GPSD fd\n"); calib_state_reset(mgr, CALIB_FAIL_GPSFIX); @@ -607,7 +610,7 @@ static void bts_recon_timer_cb(void *data) select_led_pattern(mgr); /* The connection failures are to be expected during boot */ - mgr->oc2gbts_ctrl.bts_conn->ofd->when |= BSC_FD_WRITE; + osmo_fd_write_enable(mgr->oc2gbts_ctrl.bts_conn->ofd); rc = ipa_client_conn_open(mgr->oc2gbts_ctrl.bts_conn); if (rc < 0) { LOGP(DLCTRL, LOGL_NOTICE, "Failed to connect to BTS.\n"); |