Loading...
Searching...
No Matches
ZigbeeManager.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2020 Raritan Inc. All rights reserved.
*/
#ifndef __ZIGBEEMANAGER_IDL__
#define __ZIGBEEMANAGER_IDL__
#include <Event.idl>
#include <ZigbeeDevice.idl>
/** Zigbee */
module zigbee {
/** Zigbee Manager */
interface ZigbeeManager {
/** Error Codes */
constant int ERR_DEVICE_EXISTS = 1;
constant int ERR_MAX_DEVICE_REACHED = 2;
constant int ERR_DEVICE_NOT_FOUND = 3;
constant int ERR_INVALID_PARAMS = 4;
constant int ERR_INVALID_KEY = 5;
constant int ERR_INVALID_CHANNEL = 6;
/** States for the dongle */
enumeration DongleState {
NOT_INIT, ///< no dongle
READY, ///< default state if no action in progress
ERROR, ///< something wrong
INIT_IN_PROGRESS, ///< dongle init in progress
FW_UPGRADE, ///< firmware upgrade
IN_MODEM_STATE ///< receiving state for fw update
};
/** Dongle MetaData*/
structure MetaData {
string firmwareVersion; ///< the current firmware version
string stackVersion; ///< the current stack version
};
structure Settings {
int channel; ///< channel between 11 and 26 or 0xFF for auto search
};
/** Device Registration */
structure DeviceRegistration {
int sourceId; ///< the source id to add
string key; ///< the OOB key (including CRC16)
int slot; ///< the preferred slot. 0xFFFF for auto manage
};
/** Base Event */
valueobject DeviceEvent extends idl.Event {
int sourceId; ///< the device which is affected by the event
};
/** A sensor was added */
valueobject DeviceAddedEvent extends DeviceEvent {};
/** A sensor was removed */
valueobject DeviceRemovedEvent extends DeviceEvent {};
/** Settings changed */
valueobject SettingsChangedEvent extends idl.Event {
Settings oldSettings; ///< the old settings
Settings newSettings; ///< the new settings
};
/** State changed */
valueobject StateChangedEvent extends idl.Event {
DongleState oldState; ///< the old state
DongleState newState; ///< the new state
};
/**
* Retrieve Dongle MetaData
*
* @return MetaData
*/
MetaData getMetaData();
/**
* Retrieve Dongle State
*
* @return DongleState
*/
DongleState getDongleState();
/**
* Retrieve Dongle Settings
*
* @return Settings
*/
Settings getSettings();
/**
* Set Dongle Settings
*
* @return 0 if OK
* @return ERR_INVALID_CHANNEL if the channel is invalid
* @return ERR_INVALID_PARAMS if any parameters are invalid
*/
int setSettings(in Settings settings);
/**
* Add new devices
*
* Return codes:
* 0 if OK
* ERR_DEVICE_EXISTS if device is already in list
* ERR_MAX_DEVICE_REACHED if the max device limit reached
* ERR_INVALID_KEY if the key is wrong
* ERR_INVALID_PARAMS if the entered data is invalid
* @return List of return codes for each device
*/
vector<int> addDevices(in vector<DeviceRegistration> sensors);
/**
* Remove a device
*
* @return 0 if OK
* @return ERR_DEVICE_NOT_FOUND if device is not registered
*/
int removeDevice(in int sourceId);
/**
* Get the list of registered devices
*
* @return List of all registered devices
*/
vector<ZigbeeDevice> getRegisteredDevices();
};
}
#endif /* __ZIGBEEMANAGER_IDL__ */
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::removeDevice
int removeDevice(in int sourceId)
Remove a device.
zigbee::ZigbeeManager::DongleState
DongleState
States for the dongle.
Definition ZigbeeManager.idl:26
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