heads-project / arduino_msgpack Goto Github PK
View Code? Open in Web Editor NEWmsgpack.org[Arduino C] This Arduino library provides light weight serializer and parser for messagepack
msgpack.org[Arduino C] This Arduino library provides light weight serializer and parser for messagepack
See https://github.com/HEADS-project/arduino_msgpack/blob/master/examples/test_uno_writer/test_uno_writer.ino#L37 it gives compile error.
This line should be:
msgpck_write_float(&Serial, 0.5f);
https://github.com/HEADS-project/arduino_msgpack/blob/master/msgpck.cpp#L327~L331 currently you just treat 8-bytes float as error and discard it.
can you read double the same way you read float, by defining a 8-bytes union?
union double_to_byte {
double;
byte b[8];
} b2d;
also, these 4 lines looks like typo https://github.com/HEADS-project/arduino_msgpack/blob/master/msgpck.cpp#L321~L324, should they be
b &= ...
Hi and thanx for your work
I am looking to encode/decode an array that would look like this
PHP arrays
$data = [ '1234567',
['9999999', '7654321', '64'],
['62', ['64513451334' => '' ],
[
'pin1'=>['5,2,4'],
'ipin2'=>[5,2,'readIC'=>3],
4=>[2=>80]
]
]
];
I looked at the examples but I can not understand how can I use it for such arrays which are more real life and would like to pack everything and send it in 1 package rather than splitting it in multiple parts like the examples show.
Thank you.
Hi,
I believe there is an error in the implementation of msgpck_write_integer(Stream * s, int16_t i).
If i > 127 and i <= 254, the else-part is executed. But then the number is written as an int8_t, so it will be interpreted as a negative number on the other side.
It seems that there is a case-distiction missing in the else-part: If i > 127, it should be written as uint8_t, otherwise as int8_t.
Thanks
since the Print
class has a virtual method write(data, len)
, and some sub class like HardwareSerial has optimized block write method, we should use it instead of writing bytes one by one
same for write_string
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.