Legrand / Raritan Xerus™ JSON-RPC API for Remote Access Devices like KX4-101, KX3G2
Loading...
Searching...
No Matches
Firmware.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2009 Raritan Inc. All rights reserved.
4 */
5
6#include <UserEvent.idl>
7#include <Event.idl>
8
9/**
10 * %Firmware Management
11 */
12module firmware {
13
14 /**
15 * %Firmware update history status
16 */
17 enumeration UpdateHistoryStatus {
18 SUCCESSFUL, ///< The update was successfully completed
19 FAILED, ///< The update failed
20 INCOMPLETE ///< The update was not completed
21 };
22
23 /**
24 * %Firmware update history entry
25 * TODO: implement CR# 45668 on next interface change
26 * add comment field based on firmware tag "char tag[64];"
27 * to improve firmware update history entries without rootfs images
28 */
30 time timestamp; ///< UNIX timestamp (UTC) when the update was started
31 string oldVersion; ///< Previous firmware version
32 string imageVersion; ///< Firmware version of update image
33 string product; ///< Product name
34 string platform; ///< Platform name
35 string imageMD5; ///< MD5 hash of update image
36 UpdateHistoryStatus status; ///< Update status
37 string details; ///< Details about status
38 };
39
40 /**
41 * Image upload/download state
42 */
43 enumeration ImageState {
44 NONE, ///< No firmware image has been uploaded/downloaded
45 UPLOADING, ///< A firmware image is currently being uploaded
46 UPLOAD_FAILED, ///< There was a problem uploading an image to the device
47 DOWNLOADING, ///< The device is downloading a firmware image from a URL
48 DOWNLOAD_FAILED, ///< There was a problem downloading the image from a URL
49 COMPLETE ///< A complete image has been successfully uploaded/downloaded
50 };
51
52 /**
53 * Image upload/download status
54 */
55 structure ImageStatus {
56 ImageState state; ///< Image upload/download state
57 string error_message; ///< Error message; empty if there was no error
58 time time_started; ///< UNIX timestamp (UTC) of the last state change (if available)
59 int size_total; ///< Total size of the image (if available)
60 int size_done; ///< Progress of the running upload or download (if available)
61 };
62
63 /**
64 * %Firmware image information
65 */
66 structure ImageInfo {
67 boolean valid; ///< The file is a valid firmware image
68
69 string version; ///< %Firmware image version
70 string min_required_version; ///< Minimum running firmware version for image
71 string min_downgrade_version; ///< Minimum image version for running firmware
72
73 string product; ///< Product name
74 string platform; ///< Platform name
75 string oem; ///< OEM name
76 string hwid_whitelist; ///< Hardware ID whitelist
77 string hwid_blacklist; ///< Hardware ID blacklist
78
79 boolean compatible; ///< \c true if the image is compatible with this device
80
81 boolean signature_present; ///< \c true if the image is signed
82 string signed_by; ///< Signature issuer
83 boolean signature_good; ///< \c true if the signature is valid
84 string certified_by; ///< Key certificate issuer
85 boolean certificate_good; ///< \c true if the key certificate is valid
86
87 boolean model_list_present; ///< \c true if the image includes a supported models list
88 boolean model_supported; ///< \c true if the model is found on the support list
89 };
90
91 /**
92 * Flags for startUpdate() method
93 */
94 enumeration UpdateFlags {
95 CROSS_OEM, ///< Ignore version, product and OEM constraints
96 CROSS_HW, ///< Ignore hardware constraints
97 ALLOW_UNTRUSTED ///< Allow untrusted firmwares (ignored when secure boot is active)
98 };
99
100 /** Event: System startup finished */
101 valueobject SystemStartupEvent extends idl.Event {};
102 /** Event: System shutdown started */
103 valueobject SystemShutdownEvent extends event.UserEvent {
104 boolean resettingToFactoryDefaults;
105 };
106
107 /** Event: Firmware validation failed */
108 valueobject FirmwareValidationFailedEvent extends event.UserEvent {};
109
110 /** Event: Firmware update base event */
111 valueobject FirmwareUpdateEvent extends event.UserEvent {
112 string oldVersion; ///< Firmware version the device is being upgraded from
113 string newVersion; ///< Firmware version the device is being upgraded to
114 };
115
116 /** Event: Firmware update started */
118 /** Event: Firmware updated successfully */
120 /** Event: Firmware update failed */
122
123 /**
124 * %Firmware management methods
125 */
126 interface Firmware {
127
128 /** %Firmware information */
129 structure Info {
130 string product; ///< %Firmware product type
131 string platform; ///< Hardware platform
132 string version; ///< %Firmware version number
133 };
134
135 /**
136 * Retrieve the firmware information.
137 *
138 * @return %Firmware information
139 */
141
142 /**
143 * Reboot the device.
144 *
145 * This function will fail if a firmware update is in progress.
146 */
147 void reboot();
148
149 /**
150 * Reset the device configuration to factory defaults.
151 */
153
154 /**
155 * Reset all device data to factory defaults. This includes energy
156 * counters, firmware update history and reliability data.
157 *
158 * @note This command is only available during manufacturing!
159 *
160 * @return 0 if OK
161 * @return 1 if not in production mode
162 */
164
165 /**
166 * Semi-hard factory reset for manufacturing.
167 *
168 * This command clears both the user and system configuration layer,
169 * but keeps the ETO cache and subcontroller security association.
170 *
171 * @note This command is only available during manufacturing!
172 *
173 * @return 0 if OK
174 * @return 1 if not in production mode
175 */
177
178 /**
179 * Returns the currently installed firmware version.
180 *
181 * @return %Firmware version
182 */
183 string getVersion();
184
185 /**
186 * Fetch the firmware update history.
187 *
188 * @return Vector of firmware update history entries
189 */
190 vector<UpdateHistoryEntry> getUpdateHistory();
191
192 /**
193 * Get the current firmware image upload/download status.
194 *
195 * @return Image status structure.
196 */
198
199 /**
200 * Discard the currently uploaded firmware image, cancel the update.
201 */
203
204 /**
205 * Return information about a currently uploaded firmware image.
206 *
207 * @param info %Firmware image information
208 *
209 * @return \c true if a firmware image is uploaded, \c false otherwise.
210 */
211 boolean getImageInfo(out ImageInfo info);
212
213 /**
214 * Launch the firmware update process. The device will stop handling
215 * RPC requests shortly after this method has been successfully called.
216 * The client should poll the fwupdate_progress.cgi page to monitor the
217 * update progress.
218 *
219 * @param flags List of firmware update flags; may be empty
220 */
221 void startUpdate(in vector<UpdateFlags> flags);
222 };
223
224}
Firmware management methods
Definition Firmware.idl:126
Info getInfo()
Retrieve the firmware information.
string getVersion()
Returns the currently installed firmware version.
ImageStatus getImageStatus()
Get the current firmware image upload/download status.
void factoryReset()
Reset the device configuration to factory defaults.
void startUpdate(in vector< UpdateFlags > flags)
Launch the firmware update process.
int manufacturingReset()
Semi-hard factory reset for manufacturing.
void discardImage()
Discard the currently uploaded firmware image, cancel the update.
int hardFactoryReset()
Reset all device data to factory defaults.
void reboot()
Reboot the device.
vector< UpdateHistoryEntry > getUpdateHistory()
Fetch the firmware update history.
boolean getImageInfo(out ImageInfo info)
Return information about a currently uploaded firmware image.
Firmware Management
UpdateFlags
Flags for startUpdate() method.
Definition Firmware.idl:94
@ CROSS_OEM
Ignore version, product and OEM constraints.
Definition Firmware.idl:95
@ ALLOW_UNTRUSTED
Allow untrusted firmwares (ignored when secure boot is active)
Definition Firmware.idl:97
@ CROSS_HW
Ignore hardware constraints.
Definition Firmware.idl:96
UpdateHistoryStatus
Firmware update history status
Definition Firmware.idl:17
@ FAILED
The update failed.
Definition Firmware.idl:19
@ INCOMPLETE
The update was not completed.
Definition Firmware.idl:20
@ SUCCESSFUL
The update was successfully completed.
Definition Firmware.idl:18
ImageState
Image upload/download state.
Definition Firmware.idl:43
@ UPLOADING
A firmware image is currently being uploaded.
Definition Firmware.idl:45
@ COMPLETE
A complete image has been successfully uploaded/downloaded.
Definition Firmware.idl:49
@ UPLOAD_FAILED
There was a problem uploading an image to the device.
Definition Firmware.idl:46
@ DOWNLOADING
The device is downloading a firmware image from a URL.
Definition Firmware.idl:47
@ DOWNLOAD_FAILED
There was a problem downloading the image from a URL.
Definition Firmware.idl:48
@ NONE
No firmware image has been uploaded/downloaded.
Definition Firmware.idl:44
Basic IDL definitions.
Definition Event.idl:10
Event: Firmware updated successfully.
Definition Firmware.idl:119
Event: Firmware update base event.
Definition Firmware.idl:111
string newVersion
Firmware version the device is being upgraded to.
Definition Firmware.idl:113
string oldVersion
Firmware version the device is being upgraded from.
Definition Firmware.idl:112
Event: Firmware update failed.
Definition Firmware.idl:121
Event: Firmware update started.
Definition Firmware.idl:117
Event: Firmware validation failed.
Definition Firmware.idl:108
Firmware information
Definition Firmware.idl:129
string version
Firmware version number
Definition Firmware.idl:132
string product
Firmware product type
Definition Firmware.idl:130
string platform
Hardware platform.
Definition Firmware.idl:131
Firmware image information
Definition Firmware.idl:66
boolean signature_present
true if the image is signed
Definition Firmware.idl:81
string hwid_blacklist
Hardware ID blacklist.
Definition Firmware.idl:77
string version
Firmware image version
Definition Firmware.idl:69
boolean model_list_present
true if the image includes a supported models list
Definition Firmware.idl:87
string min_downgrade_version
Minimum image version for running firmware.
Definition Firmware.idl:71
boolean signature_good
true if the signature is valid
Definition Firmware.idl:83
string oem
OEM name.
Definition Firmware.idl:75
string hwid_whitelist
Hardware ID whitelist.
Definition Firmware.idl:76
string signed_by
Signature issuer.
Definition Firmware.idl:82
boolean model_supported
true if the model is found on the support list
Definition Firmware.idl:88
boolean compatible
true if the image is compatible with this device
Definition Firmware.idl:79
string product
Product name.
Definition Firmware.idl:73
boolean certificate_good
true if the key certificate is valid
Definition Firmware.idl:85
string platform
Platform name.
Definition Firmware.idl:74
string certified_by
Key certificate issuer.
Definition Firmware.idl:84
boolean valid
The file is a valid firmware image.
Definition Firmware.idl:67
string min_required_version
Minimum running firmware version for image.
Definition Firmware.idl:70
Image upload/download status.
Definition Firmware.idl:55
int size_done
Progress of the running upload or download (if available)
Definition Firmware.idl:60
string error_message
Error message; empty if there was no error.
Definition Firmware.idl:57
ImageState state
Image upload/download state.
Definition Firmware.idl:56
time time_started
UNIX timestamp (UTC) of the last state change (if available)
Definition Firmware.idl:58
int size_total
Total size of the image (if available)
Definition Firmware.idl:59
Event: System shutdown started.
Definition Firmware.idl:103
Event: System startup finished.
Definition Firmware.idl:101
Firmware update history entry TODO: implement CR# 45668 on next interface change add comment field ba...
Definition Firmware.idl:29
string details
Details about status.
Definition Firmware.idl:37
string oldVersion
Previous firmware version.
Definition Firmware.idl:31
string platform
Platform name.
Definition Firmware.idl:34
string imageMD5
MD5 hash of update image.
Definition Firmware.idl:35
string product
Product name.
Definition Firmware.idl:33
string imageVersion
Firmware version of update image.
Definition Firmware.idl:32
UpdateHistoryStatus status
Update status.
Definition Firmware.idl:36
time timestamp
UNIX timestamp (UTC) when the update was started.
Definition Firmware.idl:30
Common base for all events.
Definition Event.idl:13