Attached is a patch to support sending time to the device.
It adds two per-bts configuration elements: tzunits and tzdir.
tzunits are the number of units from GMT. Each unit represents 15 minutes of time.
tzdir is the direction of the units from GMT. tzdir 0 means GMT-tzunits and tzdir 1 means GMT+tzunits.
So for example, if you're GMT+1 you want: bts 0 type nanobts band PCS1900 cell_identity 0 location_area_code 1 training_sequence_code 7 base_station_id_code 63 tzunits 4 tzdir 1 ms max power 15 cell reselection hysteresis 4
Thanks, Gus
Hi Gus,
On Wed, Nov 30, 2011 at 03:13:04PM -0800, Gus Bourg wrote:
Attached is a patch to support sending time to the device.
thanks a lot for the patch.
however, some remarks:
1) We actually do support ranges with negative numbers in the syntax, after commit 33f0fc3c9565308044c934c9e0c1bb81c1a26311 in libosmocore you can do something like "timezone <-19-19> (0|15|30|45)" which I believe would be a more human-friendly way of entering it in hours and minutes.
2) the internal storage could thus also be a simple "int timezone", which gets filled from the hour and minute part of the abovementioned command syntax.
3) please make sure to use a default of "cur_time->tm_gmtoff" in case the config file doesn't use per-BTS timezones. So another "int timezone_bts_specific" member might be applicable.
4) please make sure to use tab instead of " " (sequence of 8 whitespaces), or use a script that automatically takes care of that.
5) the "timezone" vty line should only be printed if the user actually configured it (i.e. timezone_bts_specific == 1).
6) there needs to be a way to completely remove the timezone statement, most likely a "no timezone" VTY command in the BTS node.
Regards, Harald
Hi Harald,
Thanks for the input. Here's the updated patch.
Gus
On Wed, Nov 30, 2011 at 11:47 PM, Harald Welte laforge@gnumonks.org wrote:
Hi Gus,
On Wed, Nov 30, 2011 at 03:13:04PM -0800, Gus Bourg wrote:
Attached is a patch to support sending time to the device.
thanks a lot for the patch.
however, some remarks:
- We actually do support ranges with negative numbers in the syntax,
after commit 33f0fc3c9565308044c934c9e0c1bb81c1a26311 in libosmocore you can do something like "timezone <-19-19> (0|15|30|45)" which I believe would be a more human-friendly way of entering it in hours and minutes.
- the internal storage could thus also be a simple "int timezone",
which gets filled from the hour and minute part of the abovementioned command syntax.
- please make sure to use a default of "cur_time->tm_gmtoff" in case
the config file doesn't use per-BTS timezones. So another "int timezone_bts_specific" member might be applicable.
- please make sure to use tab instead of " " (sequence of 8
whitespaces), or use a script that automatically takes care of that.
- the "timezone" vty line should only be printed if the user actually
configured it (i.e. timezone_bts_specific == 1).
- there needs to be a way to completely remove the timezone statement,
most likely a "no timezone" VTY command in the BTS node.
Regards, Harald
--
- Harald Welte laforge@gnumonks.org http://laforge.gnumonks.org/
============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
Apologize for so many replies. Found another bug. I think I have it actually right this time. Previously fractional hours were not set right, and the calculation for the timezone offset was all wrong when when the timezone wasn't set.
Thanks, Gus
Hi Gus,
On Thu, Dec 01, 2011 at 03:25:06PM -0800, Gus Bourg wrote:
Apologize for so many replies. Found another bug. I think I have it actually right this time. Previously fractional hours were not set right, and the calculation for the timezone offset was all wrong when when the timezone wasn't set.
thanks, patch applied.
Please keep those patches coming, we appreciate all contributions...
Why not make tzunits a signed quantity and get rid of tzdir? And why 15 minute units? I realize this is how the bts wants them, but shouldn't the config file be a bit more user-friendly?
Also it looks like the indentation is a bit messed up.