|
Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
|
Date and time configuration methods. More...
import "DateTime.idl";
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 | NtpAuthKey |
| NTP authentication key. 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... | |
| enum | NtpAuthKeyType { SHA256 , SHA512 , AES128CMAC , AES256CMAC } |
| NTP authentication key type. More... | |
Public Member Functions | |
| void | getZoneInfos (out vector< ZoneInfo > zoneInfos, in boolean useOlson) |
| List all supported time zones. | |
| int | checkNtpServer (in string ntpServer, in int ntpAuthKeyId, in NtpAuthKey ntpAuthKeyOverride) |
| Check if a specified NTP server is usable. | |
| vector< string > | getActiveNtpServers () |
| Get active NTP servers. | |
| void | getCfg (out Cfg cfg) |
| Retrieve the device date and time configuration. | |
| int | setCfg (in Cfg cfg) |
| Set the device date and time configuration. | |
| void | getTime (in boolean useOlson, out ZoneInfo zone, out boolean dstEnabled, out int utcOffset, out time currentTime) |
| Retrieve the current device date and time. | |
Public Attributes | |
| constant int | SUCCESS = 0 |
| Success code. | |
| constant int | ERR_NTP_CHECK_INTERNAL = 1 |
| NTP server check errors. | |
| constant int | ERR_NTP_CHECK_INVALID_ARGUMENT = 2 |
| constant int | ERR_NTP_CHECK_ADDRESS_RESOLVE_ERROR = 3 |
| constant int | ERR_NTP_CHECK_AUTH_KEY_ID_UNKNOWN = 4 |
| constant int | ERR_NTP_CHECK_NETWORK_OR_HOST_UNREACHABLE = 5 |
| constant int | ERR_NTP_CHECK_CONNECTION_REFUSED = 6 |
| constant int | ERR_NTP_CHECK_NO_RESPONSE = 7 |
| constant int | ERR_NTP_CHECK_RESPONSE_FORMAT_INVALID = 8 |
| constant int | ERR_NTP_CHECK_SERVER_VERSION_UNSUPPORTED = 9 |
| constant int | ERR_NTP_CHECK_MAC_MISSING_OR_INVALID = 10 |
| constant int | ERR_NTP_CHECK_MODE_INVALID = 11 |
| constant int | ERR_NTP_CHECK_SERVER_NOT_SYNCHRONIZED = 12 |
| constant int | ERR_NTP_CHECK_ROOT_DISTANCE_TOO_LARGE = 13 |
| constant int | ERR_NTP_CHECK_ORIGIN_TIME_DOES_NOT_MATCH = 14 |
| constant int | ERR_NTP_CHECK_RECV_OR_XMIT_TIME_NOT_SET = 15 |
Date and time configuration methods.
Example to set timezone (id-based approach):
Definition at line 26 of file DateTime.idl.
NTP authentication key type.
| Enumerator | |
|---|---|
| SHA256 | SHA-256 authentication key. |
| SHA512 | SHA-512 authentication key. |
| AES128CMAC | AES128-CMAC authentication key. |
| AES256CMAC | AES256-CMAC authentication key. |
Definition at line 95 of file DateTime.idl.
Time synchronization protocol.
| Enumerator | |
|---|---|
| STATIC | Device time is configured locally. |
| NTP | Device time is synchronized via NTP. |
Definition at line 89 of file DateTime.idl.
| int datetime::DateTime::checkNtpServer | ( | in string | ntpServer, |
| in int | ntpAuthKeyId, | ||
| in NtpAuthKey | ntpAuthKeyOverride ) |
Check if a specified NTP server is usable.
When calling this method a potentially referenced authentication key must have been defined first.
| ntpServer | NTP server to be checked |
| ntpAuthKeyId | NTP authentication key id (0 for no authentication) |
| ntpAuthKeyOverride | NTP authentication key (leave key data empty to use existing key & type) |
SUCCESS or one of the ERR_NTP_CHECK_* error codes | 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 configuration |
| 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. |
| constant int datetime::DateTime::ERR_NTP_CHECK_ADDRESS_RESOLVE_ERROR = 3 |
Definition at line 34 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_AUTH_KEY_ID_UNKNOWN = 4 |
Definition at line 35 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_CONNECTION_REFUSED = 6 |
Definition at line 37 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_INTERNAL = 1 |
NTP server check errors.
Definition at line 32 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_INVALID_ARGUMENT = 2 |
Definition at line 33 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_MAC_MISSING_OR_INVALID = 10 |
Definition at line 41 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_MODE_INVALID = 11 |
Definition at line 42 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_NETWORK_OR_HOST_UNREACHABLE = 5 |
Definition at line 36 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_NO_RESPONSE = 7 |
Definition at line 38 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_ORIGIN_TIME_DOES_NOT_MATCH = 14 |
Definition at line 45 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_RECV_OR_XMIT_TIME_NOT_SET = 15 |
Definition at line 46 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_RESPONSE_FORMAT_INVALID = 8 |
Definition at line 39 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_ROOT_DISTANCE_TOO_LARGE = 13 |
Definition at line 44 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_SERVER_NOT_SYNCHRONIZED = 12 |
Definition at line 43 of file DateTime.idl.
| constant int datetime::DateTime::ERR_NTP_CHECK_SERVER_VERSION_UNSUPPORTED = 9 |
Definition at line 40 of file DateTime.idl.
| constant int datetime::DateTime::SUCCESS = 0 |
Success code.
Definition at line 29 of file DateTime.idl.