clock source monitoring
Some BTS hw have stable enough clock source on board (e. g. sysmoBTS 1002), other requires external reference like gps (e. g. sysmoBTS 2050) to function properly. This should be properly monitored by OsmoBTS.
Note: it takes some time to get a lock after boot. Also you can loose lock over time during operation (we get event messages on that). A timeout-based mechanism thus would make sense. Terminate osmo-bts with a meaningful LOGL_ERROR message if there hasn't been a lock for N seconds (whether at start up or at subsequent loss of clock).Add following common infrastructure:
- how the bts-model code can report the reference clock status (lock/unlock/...)
- a vty configurable timeout for the amount of seconds after which we terminate after loss of a reference clock lock
- how the bts-model code can report the list of supported clock sources and the currently active clock to the common part (Unknown, TCXO, OCXO, GPS, External)
We might even extend that to a common VTY command for selecting the reference clock source, implemented by a bts_model_set_clock_source() command called by that VTY command.