Network Handling
Notepad Backlog
Add a Handler to send data over POST to a REST API.
Previous iteration resembled this :
{
'message': {
'header': { ... },
'data': [
{ ... },
{ ... },
...,
{ ... }
]
},
}
Current thought process (@Emmanuel.Kellner) :
{
'header': 'Some url on API dashboard',
'deviceID': '...',
'data': [
{ ... },
{ ... },
...,
{ ... }
]
}
This presents 2 advantages :
- The header can be a lean
device_id|URL
:- deviceID would be at maximum 16 characters \in [a-zA-Z0-9_-] (ie 16 bytes, for a total of
1.022 * 10^28
possibilities) - URL would be at maximum 8 characters \in [a-z0-9] (ie 8 bytes, for a total of
1.22 * 10^12
possibilities)- Secondary efficiency boost is that HTTP/S is much faster than any variation of Bluetooth, especially since this data will only be acquired via HTTP API side.
- deviceID would be at maximum 16 characters \in [a-zA-Z0-9_-] (ie 16 bytes, for a total of
- A binary header can be designed in that direction and can be implemented as extensible.
- Example : [
{
,device_id
,URL
,$
] for a total of 28 bytes over Bluetooth, and the URL would be linked to a JSON config file that would be buildable on API dashboard, with the structure described below. A tertiary advantage of this is that it unbloats the database of static data.
- Example : [
{
'specs': {
},
'data_types': {
}
}