31 #ifndef IDEVICEFAMILY_H_ 32 #define IDEVICEFAMILY_H_ 35 #include "../Database/DatabaseTypes.h" 39 #include "../Variable.h" 40 #include "../DeviceDescription/Devices.h" 62 virtual void onRemoveWebserverEventHandler(std::map<int32_t, PEventHandler> &eventHandlers) = 0;
64 virtual void onRPCEvent(std::string source, uint64_t
id, int32_t
channel, std::string deviceAddress, std::shared_ptr<std::vector<std::string>> valueKeys, std::shared_ptr<std::vector<std::shared_ptr<Variable>>> values) = 0;
65 virtual void onRPCUpdateDevice(uint64_t
id, int32_t channel, std::string address, int32_t hint) = 0;
66 virtual void onRPCNewDevices(std::vector<uint64_t> &ids, std::shared_ptr<Variable> deviceDescriptions) = 0;
67 virtual void onRPCDeleteDevices(std::vector<uint64_t> &ids, std::shared_ptr<Variable> deviceAddresses, std::shared_ptr<Variable> deviceInfo) = 0;
68 virtual void onEvent(std::string source, uint64_t peerID, int32_t channel, std::shared_ptr<std::vector<std::string>> variables, std::shared_ptr<std::vector<std::shared_ptr<Variable>>> values) = 0;
69 virtual void onServiceMessageEvent(
const PServiceMessage &serviceMessage) = 0;
73 virtual uint64_t onGetRoomIdByName(std::string &
name) = 0;
76 virtual void onDecryptDeviceDescription(int32_t moduleId,
const std::vector<char> &
input, std::vector<char> &
output) = 0;
85 virtual bool enabled();
86 virtual bool init() = 0;
89 virtual bool lifetick() = 0;
91 virtual void unlock();
92 virtual bool locked();
94 virtual int32_t getFamily();
96 virtual void setFamilySetting(
const std::string &name,
const std::string &
value);
97 virtual void setFamilySetting(
const std::string &name, int32_t value);
98 virtual void setFamilySetting(
const std::string &name,
const std::vector<char> &value);
99 virtual void deleteFamilySettingFromDatabase(
const std::string &name);
100 virtual void load() = 0;
101 virtual void save(
bool full) = 0;
102 virtual std::string getName();
103 virtual std::string handleCliCommand(std::string &command) = 0;
108 virtual void homegearStarted() = 0;
113 virtual void homegearShuttingDown() = 0;
116 virtual std::shared_ptr<Variable> getPairingInfo() = 0;
118 virtual PVariable listKnownDeviceTypes(
PRpcClientInfo clientInfo,
bool channels, std::set<std::string> &fields) = 0;
124 std::atomic_bool _locked{
false};
125 bool _disposed =
false;
130 virtual void raiseRemoveWebserverEventHandler(std::map<int32_t, PEventHandler> &eventHandlers);
132 virtual void raiseRPCEvent(std::string &source, uint64_t
id, int32_t channel, std::string &deviceAddress, std::shared_ptr<std::vector<std::string>> &valueKeys, std::shared_ptr<std::vector<std::shared_ptr<Variable>>> &values);
133 virtual void raiseRPCUpdateDevice(uint64_t
id, int32_t channel, std::string address, int32_t hint);
134 virtual void raiseRPCNewDevices(std::vector<uint64_t> &ids, std::shared_ptr<Variable> deviceDescriptions);
135 virtual void raiseRPCDeleteDevices(std::vector<uint64_t> &ids, std::shared_ptr<Variable> deviceAddresses, std::shared_ptr<Variable> deviceInfo);
136 virtual void raiseEvent(std::string &source, uint64_t peerID, int32_t channel, std::shared_ptr<std::vector<std::string>> &variables, std::shared_ptr<std::vector<std::shared_ptr<Variable>>> &values);
137 virtual void raiseServiceMessageEvent(
const PServiceMessage &serviceMessage);
141 virtual uint64_t raiseGetRoomIdByName(std::string &name);
144 virtual void raiseDecryptDeviceDescription(int32_t
moduleId,
const std::vector<char> &input, std::vector<char> &output);
151 void onRemoveWebserverEventHandler(std::map<int32_t, PEventHandler> &eventHandlers)
override;
153 void onRPCEvent(std::string &source, uint64_t
id, int32_t channel, std::string &deviceAddress, std::shared_ptr<std::vector<std::string>> &valueKeys, std::shared_ptr<std::vector<std::shared_ptr<Variable>>> &values)
override;
154 void onRPCUpdateDevice(uint64_t
id, int32_t channel, std::string address, int32_t hint)
override;
155 void onRPCNewDevices(std::vector<uint64_t> &ids, std::shared_ptr<Variable> deviceDescriptions)
override;
156 void onRPCDeleteDevices(std::vector<uint64_t> &ids, std::shared_ptr<Variable> deviceAddresses, std::shared_ptr<Variable> deviceInfo)
override;
157 void onEvent(std::string &source, uint64_t peerID, int32_t channel, std::shared_ptr<std::vector<std::string>> &variables, std::shared_ptr<std::vector<std::shared_ptr<Variable>>> &values)
override;
158 void onServiceMessageEvent(
const PServiceMessage &serviceMessage)
override;
161 uint64_t onGetRoomIdByName(std::string &name)
override;
165 void onDecryptDeviceDescription(int32_t
moduleId,
const std::vector<char> &input, std::vector<char> &output)
override;
170 virtual std::shared_ptr<ICentral> initializeCentral(uint32_t deviceId, int32_t address, std::string serialNumber) = 0;
171 virtual void createCentral() = 0;
177 int32_t _family = -1;
Definition: IDeviceFamily.h:58
FamilyType
Definition: IDeviceFamily.h:52
std::shared_ptr< FamilySettings > _settings
Definition: IDeviceFamily.h:123
int32_t deviceId
Definition: Licensing.h:381
std::shared_ptr< FamilySetting > PFamilySetting
Definition: FamilySettings.h:56
This is the base library main class.
Definition: BaseLib.h:95
Definition: ICentral.h:75
Definition: BaseLib.cpp:34
std::shared_ptr< Array > PArray
Definition: Variable.h:72
std::shared_ptr< RpcClientInfo > PRpcClientInfo
Definition: ScriptInfo.h:47
Definition: IDeviceFamily.h:79
std::shared_ptr< ScriptInfo > PScriptInfo
Definition: ScriptInfo.h:56
PVariable value
Definition: UiElements.h:217
std::shared_ptr< Variable > PVariable
Definition: PhysicalInterfaceSettings.h:41
int32_t channel
Definition: UiElements.h:215
Enum
Definition: ParameterGroup.h:63
std::string licenseKey
Definition: Licensing.h:383
int32_t moduleId
Definition: Licensing.h:379
int32_t familyId
Definition: Licensing.h:380
virtual void dispose()
Definition: IDeviceFamily.h:87
This class provides hooks into the web server so get and post requests can be passed into family modu...
Definition: IWebserverEventSink.h:43
std::string name
Definition: UiElements.h:216
std::shared_ptr< DeviceDescription::Devices > _rpcDevices
Definition: IDeviceFamily.h:168
std::shared_ptr< ServiceMessage > PServiceMessage
Definition: ServiceMessage.h:74