Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
156 views

libcbor and nested structure

I have a JSON nested structure like this: {"var1":"val1","var2":{"var1a":"val1a"}} I have generated the cbor buffer using this function from the ...
doxdici's user avatar
  • 47
-1 votes
1 answer
686 views

C++ jsoncons : cbor to json

I would like to convert cbor into json using the C++ jsoncons library (https://github.com/danielaparker/jsoncons/blob/master/doc/ref/cbor/cbor.md). But when I print the result to console some entries ...
Knöt's user avatar
  • 23
0 votes
1 answer
899 views

nlohmann::detail::parse_error: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F)

Trying to use nlohmann/json to parse some CBOR payload: #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { uint8_t data[] = {0xa2, 0x43, 0x72, ...
fferri's user avatar
  • 18.9k
1 vote
2 answers
3k views

Encoding and decoding uint8_t using TinyCbor C Library

I am implementing C++ 11 based application and I am using TinyCbor C library for Encoding and Decoding application specific data as below: #include "cbor.h" #include <iostream> using ...
User7723337's user avatar
0 votes
1 answer
814 views

Issue while encoding and decoding using CBOR

I have below class which I want to decode and encode using TinyCBOR. class Test { public: int a; int b; float c; } I am doing following to encode and decode this class: int main () { ...
User7723337's user avatar
2 votes
1 answer
800 views

Byte vector to integer type: shift and add or implicit conversion through a union?

I am currently implementing CBOR and repeatedly need to read 1, 2, 4, or 8 bytes from a byte array which then need to be combined to an integer type of 1, 2, 4, or 8 bytes. For the 4 byte case, I ...
Niels Lohmann's user avatar
0 votes
2 answers
251 views

type mapping between cbor (javascript) and c++

I don't know to which C++ types to map the following cbor (javascript) types: null undefined The other way around, I have not idea to which cbor (javascript) type to map the C++ void type.
user1095108's user avatar
  • 14.6k
0 votes
2 answers
324 views

variable template "SFINAE" not working

I'm trying to implement the size code for the cbor format with "SFINAE", for lack of a better word. But it doesn't work, as size_code<3>, for example, evaluates to 0x1b. What's wrong? template &...
user1095108's user avatar
  • 14.6k
4 votes
3 answers
4k views

Comparing uint64_t and float for numeric equivalence

I am writing a protocol, that uses RFC 7049 as its binary representation. The standard states, that the protocol may use 32-bit floating point representation of numbers, if their numeric value is ...
Alexander Shishenko's user avatar