12 #ifndef __BAOSLIB_INTERFACE_META_H__
13 #define __BAOSLIB_INTERFACE_META_H__
17 #include "wzcpp/features/utils/ByteArray.h"
60 deviceid[0] =
static_cast<std::byte
>(manufacturerApp.
data[0] & 0xff);
61 deviceid[1] =
static_cast<std::byte
>(manufacturerApp.
data[1] & 0xff);
62 deviceid[2] =
static_cast<std::byte
>(applicationId.
data[0] & 0xff);
63 deviceid[3] =
static_cast<std::byte
>(applicationId.
data[1] & 0xff);
64 deviceid[4] =
static_cast<std::byte
>(applicationVersion.
data[0] & 0xff);
74 DeviceGroupIdentifier(std::uint16_t manufacturerApp, std::uint16_t applicationId, std::uint8_t applicationVersion)
76 deviceid[0] =
static_cast<std::byte
>((manufacturerApp >> 8) & 0xff);
77 deviceid[1] =
static_cast<std::byte
>(manufacturerApp & 0xff);
78 deviceid[2] =
static_cast<std::byte
>((applicationId >> 8) & 0xff);
79 deviceid[3] =
static_cast<std::byte
>(applicationId & 0xff);
80 deviceid[4] =
static_cast<std::byte
>(applicationVersion & 0xff);
100 using UPtr = std::unique_ptr<DeviceMeta>;
108 std::map<DeviceGroupIdentifier, DeviceMeta>;
114 {{0xC5, 0x0708, 0x10},
DeviceMeta{
"771", 18, 250, 250}},
115 {{0xC5, 0x0709, 0x10},
DeviceMeta{
"772", 18, 250, 1000}},
117 {{0xC5, 0x0714, 0x10},
DeviceMeta{
"773", 18, 250, 250}},
118 {{0xC5, 0x0715, 0x10},
DeviceMeta{
"774", 18, 1000, 1000}}};
153 std::ostringstream stream;
161 stream << std::uppercase << std::setw(2) << std::setfill(
'0') << std::hex
162 <<
static_cast<short>(*first++);
163 if (first == last)
break;
168 return std::hash<std::string>()(stream.str());
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:69
BAOSLIB_EXPORT std::optional< std::uint16_t > getAvailableBufferSizeFromMeta(const wzcpp::SixByteArray &hardwareType)
std::map< DeviceGroupIdentifier, DeviceMeta > DevicesMeta
Maps the unqiue device identifier to an metainformation entry.
Definition: BaosDevicesMeta.h:108
Unique identifier for a device.
Definition: BaosDevicesMeta.h:44
std::array< std::byte, 5 > deviceid
The unique inferfacegroup id.
Definition: BaosDevicesMeta.h:94
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:52
bool operator<(const DeviceGroupIdentifier &other) const
The lesser than operator of this class.
Definition: BaosDevicesMeta.h:89
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:74
bool operator==(const DeviceGroupIdentifier &other) const
The comparision operator for the class.
Definition: BaosDevicesMeta.h:84
Structure to hold information about a serveritem.
Definition: Defines.h:404
ServerItemId id
the serveritem id
Definition: Defines.h:435
Buffer data
the data
Definition: Defines.h:437