Raritan PX2/PX3 JSON-RPC API
DateTime.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2009 Raritan Inc. All rights reserved.
4  */
5 
6 #include <Event.idl>
7 
8 /**
9  * Device Date and Time Configuration
10  */
11 module datetime {
12 
13  /** Date and time configuration methods */
14  interface DateTime_3_0_2 {
15 
16  /** Time zone information */
17  structure ZoneInfo {
18  int id; ///< Time zone id
19  string name; ///< Time zone name
20  boolean hasDSTInfo; ///< \c true if the time zone uses DST
21  };
22 
23  /** Time zone configuration */
24  structure ZoneCfg {
25  int id; ///< Selected time zone id
26  string name; ///< Selected time zone name
27  boolean enableAutoDST; ///< Enable automatic DST adjustment
28  };
29 
30  /** Time synchronization protocol */
31  enumeration Protocol {
32  STATIC, ///< Device time is configured locally
33  NTP ///< Device time is synchronized via NTP
34  };
35 
36  /** Static NTP server configuration */
37  structure NtpCfg {
38  string server1; ///< Primary NTP server
39  string server2; ///< Secondary NTP server
40  };
41 
42  /** Device date and time configuration */
43  structure Cfg {
44  ZoneCfg zoneCfg; ///< Time zone configuration
45  Protocol protocol; ///< Time synchronization protocol
46  time deviceTime; ///< Device date and time (local time)
47  NtpCfg ntpCfg; ///< NTP server configuration
48  };
49 
50  /** Event that is send when the configuration changes */
51  valueobject ConfigurationChangedEvent extends idl.Event {
52  };
53 
54  /**
55  * List all supported time zones.
56  *
57  * @param zoneInfos Result: List of time zones
58  * @param useOlson Use Olson zoneinfo names
59  */
60  void getZoneInfos(out vector<ZoneInfo> zoneInfos, in boolean useOlson);
61 
62  /**
63  * Check if a specified NTP server is usable.
64  *
65  * @param ntpServer NTP server to be checked
66  *
67  * @return \c true if the NTP server is usable
68  */
69  boolean checkNtpServer(in string ntpServer);
70 
71  /**
72  * Get active NTP servers.
73  *
74  * @return List of currently active NTP servers (IP addresses and/or hostnames)
75  */
76  vector<string> getActiveNtpServers();
77 
78  /**
79  * Retrieve the device date and time configuration.
80  *
81  * @param cfg Result: Current date and time configration
82  */
83  void getCfg(out Cfg cfg);
84 
85  /**
86  * Set the device date and time configuration.
87  * Depending on the value of the \e protocol field either \e deviceTime
88  * or \e ntpCfg will be used from the \e cfg parameter.
89  *
90  * @param cfg New date and time configuration.
91  *
92  * @return 0 if OK
93  * @return 1 if the configuration is invalid
94  */
95  int setCfg(in Cfg cfg);
96 
97  /**
98  * Retrieve the current device date and time.
99  *
100  * @param useOlson Use Olson zoneinfo name
101  * @param zone Result: Active time zone
102  * @param dstEnabled if false, the time zone DST flag is not used
103  * @param utcOffset Result: Offset (in minutes) between local time and UTC
104  * @param currentTime Result: Device date and time
105  */
106  void getTime(in boolean useOlson, out ZoneInfo zone,
107  out boolean dstEnabled, out int utcOffset,
108  out time currentTime);
109 
110  };
111 
112 }
int id
Time zone id.
Definition: DateTime.idl:18
string name
Time zone name.
Definition: DateTime.idl:19
ZoneCfg zoneCfg
Time zone configuration.
Definition: DateTime.idl:44
Static NTP server configuration.
Definition: DateTime.idl:37
NtpCfg ntpCfg
NTP server configuration.
Definition: DateTime.idl:47
Time zone information.
Definition: DateTime.idl:17
int id
Selected time zone id.
Definition: DateTime.idl:25
Basic IDL definitions.
Definition: Event.idl:10
string server2
Secondary NTP server.
Definition: DateTime.idl:39
Time zone configuration.
Definition: DateTime.idl:24
Device Date and Time Configuration.
Definition: DateTime.idl:11
Date and time configuration methods.
Definition: DateTime.idl:14
string name
Selected time zone name.
Definition: DateTime.idl:26
boolean hasDSTInfo
true if the time zone uses DST
Definition: DateTime.idl:20
Device date and time configuration.
Definition: DateTime.idl:43
boolean enableAutoDST
Enable automatic DST adjustment.
Definition: DateTime.idl:27
string server1
Primary NTP server.
Definition: DateTime.idl:38
time deviceTime
Device date and time (local time)
Definition: DateTime.idl:46
Protocol
Time synchronization protocol.
Definition: DateTime.idl:31
Device time is configured locally.
Definition: DateTime.idl:32
Protocol protocol
Time synchronization protocol.
Definition: DateTime.idl:45