Timeline for Serialise a struct containing a flexible array
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 15 at 9:44 | comment | added | 6v6gt | If you are prepared to allocate memory in advance for the worst case, you may also be able to use a union across all the "record" types (structs) that you send. You add in also a byte array to send the data. Within a union, the storage overlaps so you can use only one struct at a time. (It is not nice because C++ can add padding but, in most cases, C behavior is supported by the compiler allowing it to work. Also it can fall foul of type punning rules) | |
| Apr 15 at 8:09 | comment | added | Noel | I agree this could also posted in a C stack exchange. However the last time I did this I had answers completely out of the scope of Arduino. Things like suggesting solution with heavy libraries or answers not adapted to embedded software. My code is to run on an Arduino UNO type of hardware and it is within the framework of Arduino that I need a solution to this problem. So yes the entire post is an Arduino problem. | |
| Apr 15 at 8:02 | history | edited | Noel | CC BY-SA 4.0 |
added 193 characters in body
|
| Apr 15 at 7:26 | answer | added | Edgar Bonet | timeline score: 5 | |
| Apr 15 at 2:34 | comment | added | jsotola | which part of your post is about an Arduino problem? | |
| Apr 14 at 20:57 | history | asked | Noel | CC BY-SA 4.0 |