Implement the nodejs Backend to support both requests from the presence hardware sensor and control sound actuator using I2C protocol
Suggestion of routes
Post to handle request from sensor
/followRadio/api/sensor?mac=[the:mac:address:xxx]&presence=[1 there is people 0 there is no people]
This post will also trigger the I2C communication with the actuator
Get to serve the clients with the room presence information
/followRadio/api/roomState
Returns a json with an array of room states
Post to handle the log from the sensors
/followRadio/api/sensor
with body
{ "mac": "00:00:00:00", "ip": "xxx.xxx.xxx.xxx", "timestamp": "99:99:99", "otaHostName": "xxxxxDevice", "log_message": "xxxx xxxx xxxxx" }
Implement the nodejs Backend to support both requests from the presence hardware sensor and control sound actuator using I2C protocol
Suggestion of routes
Post to handle request from sensor /followRadio/api/sensor?mac=[the:mac:address:xxx]&presence=[1 there is people 0 there is no people] This post will also trigger the I2C communication with the actuator
Get to serve the clients with the room presence information /followRadio/api/roomState Returns a json with an array of room states
Post to handle the log from the sensors /followRadio/api/sensor
with body
{ "mac": "00:00:00:00", "ip": "xxx.xxx.xxx.xxx", "timestamp": "99:99:99", "otaHostName": "xxxxxDevice", "log_message": "xxxx xxxx xxxxx" }