Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
|
Date and time configuration methods. More...
Classes | |
struct | Cfg |
Device date and time configuration. More... | |
struct | ClockChangedEvent |
Event that is sent when the device time is changed. More... | |
struct | ConfigurationChangedEvent |
Event that is sent when the configuration changes. More... | |
struct | NtpCfg |
Static NTP server configuration. More... | |
struct | ZoneCfg |
Time zone configuration. More... | |
struct | ZoneInfo |
Time zone information (see also ZoneCfg) More... | |
Public Types | |
enum | Protocol { STATIC , NTP } |
Time synchronization protocol. More... | |
Public Member Functions | |
void | getZoneInfos (out vector< ZoneInfo > zoneInfos, in boolean useOlson) |
List all supported time zones. More... | |
boolean | checkNtpServer (in string ntpServer) |
Check if a specified NTP server is usable. More... | |
vector< string > | getActiveNtpServers () |
Get active NTP servers. More... | |
void | getCfg (out Cfg cfg) |
Retrieve the device date and time configuration. More... | |
int | setCfg (in Cfg cfg) |
Set the device date and time configuration. More... | |
void | getTime (in boolean useOlson, out ZoneInfo zone, out boolean dstEnabled, out int utcOffset, out time currentTime) |
Retrieve the current device date and time. More... | |
Date and time configuration methods.
Example to set timezone (id-based approach):
Definition at line 25 of file DateTime.idl.
Time synchronization protocol.
Enumerator | |
---|---|
STATIC | Device time is configured locally. |
NTP | Device time is synchronized via NTP. |
Definition at line 67 of file DateTime.idl.
boolean datetime::DateTime::checkNtpServer | ( | in string | ntpServer | ) |
Check if a specified NTP server is usable.
ntpServer | NTP server to be checked |
true
if the NTP server is usable vector< string > datetime::DateTime::getActiveNtpServers | ( | ) |
Get active NTP servers.
void datetime::DateTime::getCfg | ( | out Cfg | cfg | ) |
Retrieve the device date and time configuration.
cfg | Result: Current date and time configration |
void datetime::DateTime::getTime | ( | in boolean | useOlson, |
out ZoneInfo | zone, | ||
out boolean | dstEnabled, | ||
out int | utcOffset, | ||
out time | currentTime | ||
) |
Retrieve the current device date and time.
useOlson | Use Olson timezone name (see also ZoneCfg) |
zone | Result: Active time zone |
dstEnabled | if false, the time zone daylight saving time flag is not used |
utcOffset | Result: Offset (in minutes) between local time and UTC |
currentTime | Result: Device date and time (UNIX timestamp, UTC) |
void datetime::DateTime::getZoneInfos | ( | out vector< ZoneInfo > | zoneInfos, |
in boolean | useOlson | ||
) |
List all supported time zones.
zoneInfos | Result: List of time zones |
useOlson | Use Olson timezone names (see also ZoneCfg) |
int datetime::DateTime::setCfg | ( | in Cfg | cfg | ) |
Set the device date and time configuration.
Depending on the value of the protocol field either deviceTime or ntpCfg will be used from the cfg parameter.
Specific example to set timezone.
cfg | New date and time configuration. |