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