DateTime.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2009 Raritan Inc. All rights reserved.
*/
#include <Event.idl>
/**
* Device Date and Time Configuration
*/
module datetime {
/** Date and time configuration methods */
interface DateTime_3_0_2 {
/** Time zone information */
structure ZoneInfo {
int id; ///< Time zone id
string name; ///< Time zone name
boolean hasDSTInfo; ///< \c true if the time zone uses DST
};
/** Time zone configuration */
structure ZoneCfg {
int id; ///< Selected time zone id
string name; ///< Selected time zone name
boolean enableAutoDST; ///< Enable automatic DST adjustment
};
/** Time synchronization protocol */
enumeration Protocol {
STATIC, ///< Device time is configured locally
NTP ///< Device time is synchronized via NTP
};
/** Static NTP server configuration */
structure NtpCfg {
string server1; ///< Primary NTP server
string server2; ///< Secondary NTP server
};
/** Device date and time configuration */
structure Cfg {
ZoneCfg zoneCfg; ///< Time zone configuration
Protocol protocol; ///< Time synchronization protocol
time deviceTime; ///< Device date and time (local time)
NtpCfg ntpCfg; ///< NTP server configuration
};
/** Event that is send when the configuration changes */
valueobject ConfigurationChangedEvent extends idl.Event {
};
/**
* List all supported time zones.
*
* @param zoneInfos Result: List of time zones
* @param useOlson Use Olson zoneinfo names
*/
void getZoneInfos(out vector<ZoneInfo> zoneInfos, in boolean useOlson);
/**
* Check if a specified NTP server is usable.
*
* @param ntpServer NTP server to be checked
*
* @return \c true if the NTP server is usable
*/
boolean checkNtpServer(in string ntpServer);
/**
* Get active NTP servers.
*
* @return List of currently active NTP servers (IP addresses and/or hostnames)
*/
vector<string> getActiveNtpServers();
/**
* Retrieve the device date and time configuration.
*
* @param cfg Result: Current date and time configration
*/
void getCfg(out Cfg cfg);
/**
* Set the device date and time configuration.
* Depending on the value of the \e protocol field either \e deviceTime
* or \e ntpCfg will be used from the \e cfg parameter.
*
* @param cfg New date and time configuration.
*
* @return 0 if OK
* @return 1 if the configuration is invalid
*/
int setCfg(in Cfg cfg);
/**
* Retrieve the current device date and time.
*
* @param useOlson Use Olson zoneinfo name
* @param zone Result: Active time zone
* @param dstEnabled if false, the time zone DST flag is not used
* @param utcOffset Result: Offset (in minutes) between local time and UTC
* @param currentTime Result: Device date and time
*/
void getTime(in boolean useOlson, out ZoneInfo zone,
out boolean dstEnabled, out int utcOffset,
out time currentTime);
};
}
datetime::DateTime_3_0_2::ZoneInfo::id
int id
Time zone id.
Definition: DateTime.idl:18
datetime::DateTime_3_0_2::ZoneInfo::name
string name
Time zone name.
Definition: DateTime.idl:19
datetime::DateTime_3_0_2::Cfg::zoneCfg
ZoneCfg zoneCfg
Time zone configuration.
Definition: DateTime.idl:44
datetime::DateTime_3_0_2::NtpCfg
Static NTP server configuration.
Definition: DateTime.idl:37
datetime::DateTime_3_0_2::Cfg::ntpCfg
NtpCfg ntpCfg
NTP server configuration.
Definition: DateTime.idl:47
datetime::DateTime_3_0_2::ZoneInfo
Time zone information.
Definition: DateTime.idl:17
datetime::DateTime_3_0_2::ZoneCfg::id
int id
Selected time zone id.
Definition: DateTime.idl:25
idl
Basic IDL definitions.
Definition: Event.idl:10
datetime::DateTime_3_0_2::NtpCfg::server2
string server2
Secondary NTP server.
Definition: DateTime.idl:39
datetime::DateTime_3_0_2::ZoneCfg
Time zone configuration.
Definition: DateTime.idl:24
datetime
Device Date and Time Configuration.
Definition: DateTime.idl:11
datetime::DateTime_3_0_2
Date and time configuration methods.
Definition: DateTime.idl:14
datetime::DateTime_3_0_2::ZoneCfg::name
string name
Selected time zone name.
Definition: DateTime.idl:26
datetime::DateTime_3_0_2::ZoneInfo::hasDSTInfo
boolean hasDSTInfo
true if the time zone uses DST
Definition: DateTime.idl:20
datetime::DateTime_3_0_2::Cfg
Device date and time configuration.
Definition: DateTime.idl:43
datetime::DateTime_3_0_2::ZoneCfg::enableAutoDST
boolean enableAutoDST
Enable automatic DST adjustment.
Definition: DateTime.idl:27
datetime::DateTime_3_0_2::NtpCfg::server1
string server1
Primary NTP server.
Definition: DateTime.idl:38
datetime::DateTime_3_0_2::Cfg::deviceTime
time deviceTime
Device date and time (local time)
Definition: DateTime.idl:46
datetime::DateTime_3_0_2::Protocol
Protocol
Time synchronization protocol.
Definition: DateTime.idl:31
datetime::DateTime_3_0_2::STATIC
Device time is configured locally.
Definition: DateTime.idl:32
datetime::DateTime_3_0_2::Cfg::protocol
Protocol protocol
Time synchronization protocol.
Definition: DateTime.idl:45