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 */
46 structure DeviceRegistration {
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 */
80 MetaData getMetaData();
81
82 /**
83 * Retrieve Dongle State
84 *
85 * @return DongleState
86 */
87 DongleState getDongleState();
88
89 /**
90 * Retrieve Dongle Settings
91 *
92 * @return Settings
93 */
94 Settings getSettings();
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
zigbee::ZigbeeManager
Zigbee Manager.
Definition ZigbeeManager.idl:15
zigbee::ZigbeeManager::getRegisteredDevices
vector< ZigbeeDevice > getRegisteredDevices()
Get the list of registered devices.
zigbee::ZigbeeManager::addDevices
vector< int > addDevices(in vector< DeviceRegistration > sensors)
Add new devices.
zigbee::ZigbeeManager::ERR_DEVICE_EXISTS
constant int ERR_DEVICE_EXISTS
Error Codes.
Definition ZigbeeManager.idl:18
zigbee::ZigbeeManager::removeDevice
int removeDevice(in int sourceId)
Remove a device.
zigbee::ZigbeeManager::DongleState
DongleState
States for the dongle.
Definition ZigbeeManager.idl:26
zigbee::ZigbeeManager::IN_MODEM_STATE
@ IN_MODEM_STATE
receiving state for fw update
Definition ZigbeeManager.idl:32
zigbee::ZigbeeManager::INIT_IN_PROGRESS
@ INIT_IN_PROGRESS
dongle init in progress
Definition ZigbeeManager.idl:30
zigbee::ZigbeeManager::FW_UPGRADE
@ FW_UPGRADE
firmware upgrade
Definition ZigbeeManager.idl:31
zigbee::ZigbeeManager::NOT_INIT
@ NOT_INIT
no dongle
Definition ZigbeeManager.idl:27
zigbee::ZigbeeManager::READY
@ READY
default state if no action in progress
Definition ZigbeeManager.idl:28
zigbee::ZigbeeManager::ERROR
@ ERROR
something wrong
Definition ZigbeeManager.idl:29
zigbee::ZigbeeManager::getDongleState
DongleState getDongleState()
Retrieve Dongle State.
zigbee::ZigbeeManager::setSettings
int setSettings(in Settings settings)
Set Dongle Settings.
zigbee::ZigbeeManager::getSettings
Settings getSettings()
Retrieve Dongle Settings.
zigbee::ZigbeeManager::getMetaData
MetaData getMetaData()
Retrieve Dongle MetaData.
idl
Basic IDL definitions.
Definition Event.idl:10
sensors
Sensors Model.
Definition AccumulatingNumericSensor.idl:13
zigbee
Zigbee.
Definition ZigbeeDevice.idl:12
idl::Event
Common base for all events.
Definition Event.idl:13
zigbee::ZigbeeManager::DeviceAddedEvent
A sensor was added.
Definition ZigbeeManager.idl:58
zigbee::ZigbeeManager::DeviceEvent
Base Event.
Definition ZigbeeManager.idl:53
zigbee::ZigbeeManager::DeviceEvent::sourceId
int sourceId
the device which is affected by the event
Definition ZigbeeManager.idl:54
zigbee::ZigbeeManager::DeviceRegistration
Device Registration.
Definition ZigbeeManager.idl:46
zigbee::ZigbeeManager::DeviceRegistration::sourceId
int sourceId
the source id to add
Definition ZigbeeManager.idl:47
zigbee::ZigbeeManager::DeviceRegistration::slot
int slot
the preferred slot. 0xFFFF for auto manage
Definition ZigbeeManager.idl:49
zigbee::ZigbeeManager::DeviceRegistration::key
string key
the OOB key (including CRC16)
Definition ZigbeeManager.idl:48
zigbee::ZigbeeManager::DeviceRemovedEvent
A sensor was removed.
Definition ZigbeeManager.idl:61
zigbee::ZigbeeManager::MetaData
Dongle MetaData.
Definition ZigbeeManager.idl:36
zigbee::ZigbeeManager::MetaData::firmwareVersion
string firmwareVersion
the current firmware version
Definition ZigbeeManager.idl:37
zigbee::ZigbeeManager::MetaData::stackVersion
string stackVersion
the current stack version
Definition ZigbeeManager.idl:38
zigbee::ZigbeeManager::SettingsChangedEvent
Settings changed.
Definition ZigbeeManager.idl:64
zigbee::ZigbeeManager::SettingsChangedEvent::oldSettings
Settings oldSettings
the old settings
Definition ZigbeeManager.idl:65
zigbee::ZigbeeManager::SettingsChangedEvent::newSettings
Settings newSettings
the new settings
Definition ZigbeeManager.idl:66
zigbee::ZigbeeManager::Settings
Definition ZigbeeManager.idl:41
zigbee::ZigbeeManager::Settings::channel
int channel
channel between 11 and 26 or 0xFF for auto search
Definition ZigbeeManager.idl:42
zigbee::ZigbeeManager::StateChangedEvent
State changed.
Definition ZigbeeManager.idl:70
zigbee::ZigbeeManager::StateChangedEvent::oldState
DongleState oldState
the old state
Definition ZigbeeManager.idl:71
zigbee::ZigbeeManager::StateChangedEvent::newState
DongleState newState
the new state
Definition ZigbeeManager.idl:72