1
0
Fork 0

Removed versioning because it's not necessary

This commit is contained in:
Avamander 2021-11-28 19:13:03 +02:00
parent 657dc3a9ba
commit 900598a7ee

View file

@ -48,18 +48,11 @@ namespace Pinetime {
} }
// Decode // Decode
QCBORDecodeContext decodeContext; QCBORDecodeContext decodeContext;
UsefulBufC encodedCbor; UsefulBufC encodedCbor = {ctxt->om, OS_MBUF_PKTLEN(ctxt->om)};
// TODO: Check, uninit fine?
QCBORDecode_Init(&decodeContext, encodedCbor, QCBOR_DECODE_MODE_NORMAL); QCBORDecode_Init(&decodeContext, encodedCbor, QCBOR_DECODE_MODE_NORMAL);
QCBORDecode_EnterMap(&decodeContext, nullptr); QCBORDecode_EnterMap(&decodeContext, nullptr);
// Always encodes to the smallest number of bytes based on the value // Always encodes to the smallest number of bytes based on the value
int64_t tmpVersion = 0;
QCBORDecode_GetInt64InMapSZ(&decodeContext, "Version", &tmpVersion);
if (tmpVersion != 1) {
// TODO: Return better error?
return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN;
}
int64_t tmpTimestamp = 0; int64_t tmpTimestamp = 0;
QCBORDecode_GetInt64InMapSZ(&decodeContext, "Timestamp", &tmpTimestamp); QCBORDecode_GetInt64InMapSZ(&decodeContext, "Timestamp", &tmpTimestamp);
int64_t tmpExpires = 0; int64_t tmpExpires = 0;