Raritan / Server Technology Xerus™ PDU JSON-RPC API
ZigbeeManager.idl
1 #ifndef __ZIGBEEMANAGER_IDL__
2 #define __ZIGBEEMANAGER_IDL__
3 
4 #include <Event.idl>
5 #include <ZigbeeDevice.idl>
6 
7 /** Zigbee */
8 module zigbee {
9  /** Zigbee Manager */
10  interface ZigbeeManager {
11 
12  /** Error Codes */
13  constant int ERR_DEVICE_EXISTS = 1;
14  constant int ERR_MAX_DEVICE_REACHED = 2;
15  constant int ERR_DEVICE_NOT_FOUND = 3;
16  constant int ERR_INVALID_PARAMS = 4;
17  constant int ERR_INVALID_KEY = 5;
18  constant int ERR_INVALID_CHANNEL = 6;
19 
20  /** States for the dongle */
21  enumeration DongleState {
22  NOT_INIT, ///< no dongle
23  READY, ///< default state if no action in progress
24  ERROR, ///< something wrong
25  INIT_IN_PROGRESS, ///< dongle init in progress
26  FW_UPGRADE, ///< firmware upgrade
27  IN_MODEM_STATE ///< receiving state for fw update
28  };
29 
30  /** Dongle MetaData*/
31  structure MetaData {
32  string firmwareVersion; ///< the current firmware version
33  string stackVersion; ///< the current stack version
34  };
35 
36  structure Settings {
37  int channel; ///< channel between 11 and 26 or 0xFF for auto search
38  };
39 
40  /** Device Registration */
41  structure DeviceRegistration {
42  int sourceId; ///< the source id to add
43  string key; ///< the OOB key (including CRC16)
44  int slot; ///< the preferred slot. 0xFFFF for auto manage
45  };
46 
47  /** Base Event */
48  valueobject DeviceEvent extends idl.Event {
49  int sourceId; ///< the device which is affected by the event
50  };
51 
52  /** A sensor was added */
53  valueobject DeviceAddedEvent extends DeviceEvent {};
54 
55  /** A sensor was removed */
56  valueobject DeviceRemovedEvent extends DeviceEvent {};
57 
58  /** Settings changed */
59  valueobject SettingsChangedEvent extends idl.Event {
60  Settings oldSettings; ///< the old settings
61  Settings newSettings; ///< the new settings
62  };
63 
64  /** State changed */
65  valueobject StateChangedEvent extends idl.Event {
66  DongleState oldState; ///< the old state
67  DongleState newState; ///< the new state
68  };
69 
70  /**
71  * Retrieve Dongle MetaData
72  *
73  * @return MetaData
74  */
76 
77  /**
78  * Retrieve Dongle State
79  *
80  * @return DongleState
81  */
83 
84  /**
85  * Retrieve Dongle Settings
86  *
87  * @return Settings
88  */
90 
91  /**
92  * Set Dongle Settings
93  *
94  * @return 0 if OK
95  * @return ERR_INVALID_CHANNEL if the channel is invalid
96  * @return ERR_INVALID_PARAMS if any parameters are invalid
97  */
98  int setSettings(in Settings settings);
99 
100  /**
101  * Add new devices
102  *
103  * Return codes:
104  * 0 if OK
105  * ERR_DEVICE_EXISTS if device is already in list
106  * ERR_MAX_DEVICE_REACHED if the max device limit reached
107  * ERR_INVALID_KEY if the key is wrong
108  * ERR_INVALID_PARAMS if the entered data is invalid
109  * @return List of return codes for each device
110  */
111  vector<int> addDevices(in vector<DeviceRegistration> sensors);
112 
113  /**
114  * Remove a device
115  *
116  * @return 0 if OK
117  * @return ERR_DEVICE_NOT_FOUND if device is not registered
118  */
119  int removeDevice(in int sourceId);
120 
121  /**
122  * Get the list of registered devices
123  *
124  * @return List of all registered devices
125  */
126  vector<ZigbeeDevice> getRegisteredDevices();
127  };
128 
129 }
130 
131 #endif /* __ZIGBEEMANAGER_IDL__ */
132 
Zigbee Manager.
Definition: ZigbeeManager.idl:10
vector< ZigbeeDevice > getRegisteredDevices()
Get the list of registered devices.
DongleState newState
the new state
Definition: ZigbeeManager.idl:67
Settings newSettings
the new settings
Definition: ZigbeeManager.idl:61
int removeDevice(in int sourceId)
Remove a device.
vector< int > addDevices(in vector< DeviceRegistration > sensors)
Add new devices.
DongleState
States for the dongle.
Definition: ZigbeeManager.idl:21
@ INIT_IN_PROGRESS
dongle init in progress
Definition: ZigbeeManager.idl:25
@ FW_UPGRADE
firmware upgrade
Definition: ZigbeeManager.idl:26
@ NOT_INIT
no dongle
Definition: ZigbeeManager.idl:22
@ READY
default state if no action in progress
Definition: ZigbeeManager.idl:23
@ ERROR
something wrong
Definition: ZigbeeManager.idl:24
DongleState getDongleState()
Retrieve Dongle State.
int setSettings(in Settings settings)
Set Dongle Settings.
Settings getSettings()
Retrieve Dongle Settings.
MetaData getMetaData()
Retrieve Dongle MetaData.
Basic IDL definitions.
Definition: Event.idl:10
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
Zigbee.
Definition: ZigbeeDevice.idl:7
Device Registration.
Definition: ZigbeeManager.idl:41
int sourceId
the source id to add
Definition: ZigbeeManager.idl:42
int slot
the preferred slot. 0xFFFF for auto manage
Definition: ZigbeeManager.idl:44
string key
the OOB key (including CRC16)
Definition: ZigbeeManager.idl:43
Dongle MetaData.
Definition: ZigbeeManager.idl:31
string firmwareVersion
the current firmware version
Definition: ZigbeeManager.idl:32
string stackVersion
the current stack version
Definition: ZigbeeManager.idl:33
Definition: ZigbeeManager.idl:36
int channel
channel between 11 and 26 or 0xFF for auto search
Definition: ZigbeeManager.idl:37