12 + k_reserved1Size * sizeof(
uint8_t)
14 + k_compatibleIDSize * sizeof(
uint8_t)
15 + k_compatibleIDSize * sizeof(
uint8_t)
16 + k_reserved2Size * sizeof(
uint8_t)),
20 m_reserved1{0, 0, 0, 0, 0, 0, 0},
21 m_bFirstInterfaceNumber(0),
23 m_subCompatibleID{0, 0, 0, 0, 0, 0, 0, 0},
24 m_reserved2{0, 0, 0, 0, 0, 0}
28 size_t compatibleIDSize =
strlen(compatibleID);
29 size_t compatibleIDCopySize = k_compatibleIDSize < compatibleIDSize ? k_compatibleIDSize : compatibleIDSize;
30 for (
size_t i = 0; i < compatibleIDCopySize; i++) {
31 m_compatibleID[i] = compatibleID[i];
33 for (
size_t i = compatibleIDCopySize; i < k_compatibleIDSize; i++) {
34 m_compatibleID[i] = 0;
40 c->push(m_bcdVersion);
43 for (
uint8_t i = 0; i < k_reserved1Size; i++) {
44 c->push(m_reserved1[i]);
46 c->push(m_bFirstInterfaceNumber);
48 for (
uint8_t i = 0; i < k_compatibleIDSize; i++) {
49 c->push(m_compatibleID[i]);
51 for (
uint8_t i = 0; i < k_compatibleIDSize; i++) {
52 c->push(m_subCompatibleID[i]);
54 for (
uint8_t i = 0; i < k_reserved2Size; i++) {
55 c->push(m_reserved2[i]);
void push(Channel *c) const override
size_t strlen(const char *s)
ExtendedCompatIDDescriptor(const char *compatibleID)