From 5e3cbab5a3233542c1a0345c485813a00a281d36 Mon Sep 17 00:00:00 2001 From: Pierre Wielders Date: Thu, 11 Jan 2024 18:43:15 +0100 Subject: [PATCH] [IZIGWAVE] Update the interface to use the new generators.. (#318) --- interfaces/IZigWave.h | 50 +++++++++++++++++++-------- interfaces/Ids.h | 1 + interfaces/Interfaces.vcxproj | 1 + interfaces/Interfaces.vcxproj.filters | 3 ++ 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/interfaces/IZigWave.h b/interfaces/IZigWave.h index 6fced172..789fa26e 100644 --- a/interfaces/IZigWave.h +++ b/interfaces/IZigWave.h @@ -30,6 +30,31 @@ namespace WPEFramework { struct EXTERNAL IZigWave : virtual public Core::IUnknown { enum { ID = ID_ZIGWAVE }; + struct Device { + enum type : uint8_t { + END_DEVICE, + ROUTER, + CONTROLLER + }; + + uint32_t Parent /* @brief address of the Parent */; + uint32_t Address /* @brief address of the device */; + type Type /* @brief type of the device */; + uint16_t Manufacturer /* @brief manufactured of this device */; + string Metadata /* metadata associated with this device */; + }; + + struct Controller { + bool Permutable; + string Port; + uint32_t Id; + uint8_t Major; + uint8_t Minor; + uint16_t Nodes; + }; + + using IDeviceIterator = RPC::IIteratorType; + // @property // @brief To allow new devices to the network, the controller should be placed // into an accepting mode. By enabling this mode, the controller can @@ -37,29 +62,26 @@ namespace WPEFramework { // @param enabled (true) or disable (false) the accepting mode. // /* @alt accept */ - virtual uint32_t Permutable(const uint32_t address /* @index */, bool& enabled /* @out */) const = 0; - virtual uint32_t Permutable(const uint32_t address /* @index */, const bool enabled) = 0; + virtual Core::hresult Permutable(const uint32_t address /* @index */, bool& enabled /* @out */) const = 0; + virtual Core::hresult Permutable(const uint32_t address /* @index */, const bool enabled) = 0; // @property - // @brief To allow new devices to the network, the controller should be placed - // into an accepting mode. By enabling this mode, the controller can - // accept new devices. - // @param enabled (true) or disable (false) the accepting mode. + // @brief Get the information of available devices. An id of 0xFFFFFFFF means + // all devices available by this plugin. // - virtual uint32_t Device(const uint32_t id /* @index */, string& metadata /* @out */) const = 0; - - // @brief All devices currently available - // @return devices: array of ids from the available devices. - /* @json:omit */ - virtual uint32_t Devices(RPC::IValueIterator*& devices /* @out */) const = 0; + virtual Core::hresult Devices(const uint32_t id /* @index */, IDeviceIterator*& devices /* @out */) const = 0; // @brief Bind the *out* from the soure to the *in* of the destination // @return: The success of the binding action. - virtual uint32_t Bind(const uint32_t source, const uint32_t destination) = 0; + virtual Core::hresult Bind(const uint32_t source, const uint32_t destination) = 0; // @brief Unbind the *out* from the soure to the *in* of the destination // @return: The success of the unbinding action. - virtual uint32_t Unbind(const uint32_t source, const uint32_t destination) = 0; + virtual Core::hresult Unbind(const uint32_t source, const uint32_t destination) = 0; + + // @brief return the Metadata associated with the controller for this instance. + // @return: The success of the Metdata action. + virtual Core::hresult Metadata(Controller& metadata /* @out */) const = 0; }; } } diff --git a/interfaces/Ids.h b/interfaces/Ids.h index 0d97ae4d..d2126843 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -307,6 +307,7 @@ namespace Exchange { ID_VALUE_POINT_CATALOG_NOTIFICATION = ID_VALUE_POINT + 3, ID_ZIGWAVE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x410, + ID_ZIGWAVE_DEVICE_ITERATOR = ID_ZIGWAVE + 1, ID_TIMEZONE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x420, ID_TIMEZONE_NOTIFICATION = ID_TIMEZONE + 1, diff --git a/interfaces/Interfaces.vcxproj b/interfaces/Interfaces.vcxproj index 000c345a..8eae6444 100644 --- a/interfaces/Interfaces.vcxproj +++ b/interfaces/Interfaces.vcxproj @@ -160,6 +160,7 @@ + diff --git a/interfaces/Interfaces.vcxproj.filters b/interfaces/Interfaces.vcxproj.filters index 2e0eec64..3e973338 100644 --- a/interfaces/Interfaces.vcxproj.filters +++ b/interfaces/Interfaces.vcxproj.filters @@ -431,6 +431,9 @@ Interface Files + + Interface Files +