Skip to content

Commit

Permalink
[IZIGWAVE] Update the interface to use the new generators.. (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwielders authored Jan 11, 2024
1 parent 2f337b1 commit 5e3cbab
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
50 changes: 36 additions & 14 deletions interfaces/IZigWave.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,58 @@ 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<Device, ID_ZIGWAVE_DEVICE_ITERATOR>;

// @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.
//
/* @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;
};
}
}
1 change: 1 addition & 0 deletions interfaces/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions interfaces/Interfaces.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
<ClInclude Include="IWebDriver.h" />
<ClInclude Include="IWebServer.h" />
<ClInclude Include="IWifiControl.h" />
<ClInclude Include="IZigWave.h" />
<ClInclude Include="Module.h" />
<ClInclude Include="ValuePoint.h" />
</ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions interfaces/Interfaces.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@
<ClInclude Include="IStoreCache.h">
<Filter>Interface Files</Filter>
</ClInclude>
<ClInclude Include="IZigWave.h">
<Filter>Interface Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
Expand Down

0 comments on commit 5e3cbab

Please sign in to comment.