12 #ifndef __BAOSLIB_INTERFACE_META_H__
13 #define __BAOSLIB_INTERFACE_META_H__
17 #include "wzcpp/features/utils/Formatter.h"
59 deviceid[0] =
static_cast<std::byte
>(manufacturerApp.
data[0] & 0xff);
60 deviceid[1] =
static_cast<std::byte
>(manufacturerApp.
data[1] & 0xff);
61 deviceid[2] =
static_cast<std::byte
>(applicationId.
data[0] & 0xff);
62 deviceid[3] =
static_cast<std::byte
>(applicationId.
data[1] & 0xff);
63 deviceid[4] =
static_cast<std::byte
>(applicationVersion.
data[0] & 0xff);
73 DeviceGroupIdentifier(std::uint16_t manufacturerApp, std::uint16_t applicationId, std::uint8_t applicationVersion)
75 deviceid[0] =
static_cast<std::byte
>((manufacturerApp >> 8) & 0xff);
76 deviceid[1] =
static_cast<std::byte
>(manufacturerApp & 0xff);
77 deviceid[2] =
static_cast<std::byte
>((applicationId >> 8) & 0xff);
78 deviceid[3] =
static_cast<std::byte
>(applicationId & 0xff);
79 deviceid[4] =
static_cast<std::byte
>(applicationVersion & 0xff);
99 using UPtr = std::unique_ptr<DeviceMeta>;
107 std::map<DeviceGroupIdentifier, DeviceMeta>;
113 {{0xC5, 0x0708, 0x10},
DeviceMeta{
"771", 18, 250, 250}},
114 {{0xC5, 0x0709, 0x10},
DeviceMeta{
"772", 18, 250, 1000}},
116 {{0xC5, 0x0714, 0x10},
DeviceMeta{
"773", 18, 250, 250}},
117 {{0xC5, 0x0715, 0x10},
DeviceMeta{
"774", 18, 1000, 1000}}};
131 struct hash<wz::baos::DeviceGroupIdentifier>
145 auto hexString = wzcpp::rangeToHex<std::array<std::byte, 5>>(k.
deviceid);
146 return std::hash<std::string>()(hexString);
Global BAOS protocol defines and types.
@ ApplicationVersion
(Read Only; 1 bytes)
@ ManufactureCodeApp
(Read Only; 2 bytes)
@ ApplicationId
(Read Only; 2 bytes)
Global BAOS sdk namespace.
Definition: config.h:62
std::map< DeviceGroupIdentifier, DeviceMeta > DevicesMeta
Maps the unqiue device identifier to an metainformation entry.
Definition: BaosDevicesMeta.h:107
Unique identifier for a device.
Definition: BaosDevicesMeta.h:43
std::array< std::byte, 5 > deviceid
The unique inferfacegroup id.
Definition: BaosDevicesMeta.h:93
DeviceGroupIdentifier(const protocol::ServerItem &manufacturerApp, const protocol::ServerItem &applicationId, const protocol::ServerItem &applicationVersion)
Construct a new Device Identifier object build from baos::protocol::ServerItem elements.
Definition: BaosDevicesMeta.h:51
bool operator<(const DeviceGroupIdentifier &other) const
The lesser than operator of this class.
Definition: BaosDevicesMeta.h:88
DeviceGroupIdentifier(std::uint16_t manufacturerApp, std::uint16_t applicationId, std::uint8_t applicationVersion)
Construct a new Device Identifier object from intergral values.
Definition: BaosDevicesMeta.h:73
bool operator==(const DeviceGroupIdentifier &other) const
The comparision operator for the class.
Definition: BaosDevicesMeta.h:83
Structure to hold information about a serveritem.
Definition: Defines.h:403
ServerItemId id
the serveritem id
Definition: Defines.h:416
Buffer data
the data
Definition: Defines.h:418