Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ernestum/arduinojson-json-rpc
An example of a minimal test implementation of json-rpc using the ArduinoJson library
https://github.com/ernestum/arduinojson-json-rpc
arduino arduino-json json-rpc-api json-rpc-server json-rpc2
Last synced: 11 days ago
JSON representation
An example of a minimal test implementation of json-rpc using the ArduinoJson library
- Host: GitHub
- URL: https://github.com/ernestum/arduinojson-json-rpc
- Owner: ernestum
- License: gpl-3.0
- Created: 2024-03-03T21:45:46.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-05T23:50:08.000Z (8 months ago)
- Last Synced: 2024-03-06T00:24:00.481Z (8 months ago)
- Topics: arduino, arduino-json, json-rpc-api, json-rpc-server, json-rpc2
- Language: C++
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
An example of a minimal test implementation of json-rpc using the [ArduinoJson library](https://arduinojson.org/).
The purpose is to find a good balance between library size and the amount of glue code between json-rpc and the user code.
As transports, Serial and HTTP are implemented.
Mostly untested.
Q&A:
- **Why do I have to write so much boilerplate code?** Otherwise we would have to use some template magic, that probably only works in C++17. Also: the thing would only be understandable/modifiable to some C++ wizzards. Also: you would perceive it as magic and would notbe so aware any more that all your funciton calls are squeezed through inefficient JSON.
- **Why use an std::unordered_map for the lookup table?** Because I was lazy. Feel free do use something different. This is not a library, it is an example. Maybe use list of (name, function) tuples sorted buy name and bisect on that list. Maybe sort the list by usage frequency during runtime and do a linear search. Maybe do both approaches. Wow.