Commit Graph

16 Commits

Author SHA1 Message Date
Pau Espin b8ae49d0ca bts-sysmo: Replace use of deprecated ipa_client_conn_create API
"""
osmo-bts/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c:544:9: warning:
‘ipa_client_conn_create’ is deprecated: Use ipa_client_conn_create2()
instead [-Wdeprecated-declarations]
"""

Change-Id: Ief4d629f366e4f69ccd489198302568a919b2f0c
2022-06-21 09:38:42 +00:00
Harald Welte 6eb98ab25c Use osmo_fd_*_{disable,enable}
Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
Change-Id: I0da17d851ccb83c28a70c9039d0a4d1fe63da0ec
2021-02-03 10:41:16 +01:00
Harald Welte 629824ac14 use osmo_fd_setup() everywhere
Change-Id: I9be55f791a15fae2362dc431dc778b9b9d8db349
2020-10-19 15:06:08 +00:00
Pau Espin 63920cefa6 Use OSMO_FD_* instead of deprecated BSC_FD_*
New define is available since libosmocore 1.1.0, and we already require
1.3.0, so no need to update dependenices.
Let's change it to avoid people re-using old BSC_FD_READ symbol when
copy-pasting somewhere else.

Change-Id: Id51ccb2c273c5f0fa4986f28bbd69a72d2dbaa0e
2020-05-09 18:59:47 +02:00
Martin Hauke fc5f20a713 Rename variable: CALIB_SUCESS -> CALIB_SUCCESS
Correct the name of this variable.

Change-Id: I75cb6404d772b79933d1d9d694abf8eff1fad020
2019-10-17 08:05:35 +00:00
Pau Espin 8564ececa5 sysmobts_mgr: Add support for gpsd < 2.96
This allows running sysmobts-mgr on systems with old gpsd releases
(which may have other software depending on such old release).

GPSD_API_MAJOR_VERSION define was first added in gpsd 2.39, before that
it didn't exist (but this code is known to work against 2.38).

GPSD_API_MAJOR_VERSION == 5 was set in version 2.96.

Related gpsd commits:
3771dba081bd1175adab6096d7b6270d3822aaa1
e69bcb6b01af6b25c6a525fb1961b92ac04f5213

Related: SYS#4290
Change-Id: If3c35021a020a61d5fa3cde5eebcd09908db822b
2018-12-18 21:40:00 +01:00
Pau Espin 17ffb08de0 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
2018-12-18 21:40:00 +01:00
Pau Espin 2910b78305 {oc2g,sysmo}-mgr-calib: Fix build against gpsd >= 3.18
Change-Id: I1f9176432b3a01bd5e8c179dc269e391df2d446f
2018-10-29 18:17:04 +01:00
Holger Hans Peter Freyther 0d6946741c sysmobts: Check mgr->calib.bts_conn for NULL
Check the right variable for NULL.

Fixes: CID 1262214
2015-01-10 18:06:29 +01:00
Holger Hans Peter Freyther 84e4dd92d4 sysmobts: Improve some log messages for calib control
* Print the GPS FD that was opened (e.g. to see if it was
  closed again)
* Print the state changes/expectations
* Print the correct to be applied. I wondered if I shouldo do
  a cor = cor * -1.. cor = -cor.. or add CLOCK_CORR(err) macro
  to use it inside the printf and correction and decided the
  gain is not worth the risk.
2015-01-10 09:15:27 +01:00
Holger Hans Peter Freyther 55da9874c0 sysmobts: Create a calibration loop that will be run
Continously run the calibration process. Everytime we call the
reset function classify the outcome. In case of a failure schedule
the next command soon and otherwise wait several hours.

Remember if the process was started through the VTY or the run
loop. In case it can't be started immediately reset and schedule
a new run.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther d8d5f5904f sysmobts: Start the calibration the first time the link is up
After a reboot the system might have been off for a long time
and the currently used value might be wrong. Remember that we
never ran the calibration and execute it on start.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther 9acc82ce4a sysmobts: Initial version to use libgps to determine FIX state
We should only calibrate the clock if there is a GPS fix. Start
gpsd to determine if there is a fix or not. Work around trimble
decoding issues (sent an email upstream). We need to gain some
more experience to see if there memory leaks. We also need to
re-schedule the calibration depending on the outcome.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther c017e309c4 sysmobts: The correction for GPS is in the reverse direction
Change the sign before passing it as correction value. The error
is the difference between the TCXO and GPS. We need to correct by
the reverse of the error. This seems to be different depending on
the clock source we have.

This is a last minute untested change.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther 2e59b20204 sysmobts: Use the ctrl interface for calibration
This runs the entire procedure for calibration with reasonable
error and success checking. It can be triggered from the VTY
of the sysmobts-mgr right now.

What is missing is to hook up with GPSD to check if the system
has a fix and provide a mode that will continously run the
calibration command.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther 50131c125e sysmobts: Begin with calib control from the sysmobts manager
In the long run we will connect to GPSD and wait for a fix and
then run the calibration. The first step is to open (and re-open)
the control connection to the BTS.

As the connection is on localhost there should not be a computation
overhead to always have the connection open. When connecting assume
that the ASYNC connect worked directly as otherwise we get no
notification of the failure.

This looks like a "bug" of libosmo-abis that should check if the
socket has been connected or not.
2015-01-09 21:57:13 +01:00