timstableford / bsonpp Goto Github PK
View Code? Open in Web Editor NEWStack based C++ BSON serialization and parsing library
License: MIT License
Stack based C++ BSON serialization and parsing library
License: MIT License
Hi there,
I'm working on an embedded project to translate MIDI signals for vintage synthesizers. I need to send complex messages to the device to load/save settings. I initially rolled my own communication protocol for these messages, but that strategy won't scale, so I want to move to a standard data format like BSON, so I can spend less time on writing (de)serialization code.
I gave the bsonpp library a try, but I'm running into an issue. Here is an example message I want to send, in JSON format:
{
"cmd": 1,
"ctrl": {
"rows": 2,
"cols": 4,
"ccs": [1, 2, 3, 4, 5, 6, 7, 8]
},
"outs": [
{
"pid": 1,
"sid": 1,
"mfg": "Roland",
"syn": "Juno 60",
"chn": 1,
"ccs": [11, 12, 13, 14, 15, 16, 17, 18]
}
]
}
I was able to parse the cmd
and ctrl
fields, but calling document.getKeyCount()
returns BSONPP_INCORRECT_TYPE
. Attempting to parse the outs
field also fails.
I simplified the message down to narrow down the issue. It looks like having any keys after a sub-document will cause these issues.
For example, bsonpp fails to parse the last
field value on this simpler document:
{
"cmd": 1,
"ctrl": {
"rows": 2,
"cols": 4
},
"last": 42
}
Hopefully this is enough info to repro the issue. Thanks for your work on this library!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.