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
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
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
* 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.
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.
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.
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.
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.
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.
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.