#include <stdio.h>
#define DEBUG_LOG_MODULE_NAME "CBOR APP"
#define DEBUG_LOG_MAX_LEVEL LVL_INFO
static uint8_t m_cbor_buffer[] = {0xA5,
0x00,
0x50,
0x00,
0x01,
0x02,
0x03,
0x04,
0x05,
0x06,
0x07,
0x08,
0x09,
0x0A,
0x0B,
0x0C,
0x0D,
0x0E,
0x0F,
0x01,
0x6B,
'T',
'e',
's',
't',
' ',
'S',
't',
'r',
'i',
'n',
'g',
0x02,
0x18,
0x1F,
0x03,
0x20,
0x04,
0x1A,
0x07,
0x5B,
0xCD,
0x15};
static bool dumprecursive(
CborValue *it,
int nestingLevel)
{
char indent[32];
int idx = 0, lvl = nestingLevel;
while (lvl--)
{
indent[idx++] = ' ';
indent[idx++] = ' ';
}
indent[idx] = '\0';
{
switch (type)
{
{
{
return err;
}
err = dumprecursive(&recursed, nestingLevel + 1);
{
return err;
}
{
return err;
}
continue;
}
{
int val;
{
return err;
}
break;
}
{
uint8_t data[64];
size_t n = 64;
{
return err;
}
continue;
}
{
char data[64];
size_t n = 64;
{
return err;
}
continue;
}
{
break;
}
{
uint8_t type;
break;
}
{
break;
}
{
break;
}
{
bool val;
LOG(
LVL_INFO,
"%sBoolean: %s", indent, val ?
"true" :
"false");
break;
}
{
break;
}
break;
}
{
return err;
}
}
}
{
int len = sizeof(m_cbor_buffer);
{
}
{
err = dumprecursive(&value, 0);
}
{
value.
ptr - m_cbor_buffer,
}
}