-
Notifications
You must be signed in to change notification settings - Fork 6
syncEmergencyApi
Exclusively designed for microcontroller integration, the Synchronize Emergency State API manages emergencies triggered by the microcontroller's emergency button. Utilizing the PUT method, it communicates the state via the request's emergency field, initiating a broadcast through socketio.emit to update the web interface.
Developers have the capability to disable all trigger buttons on the homepage until the emergency state (set by emitting 0) is reset. This ensures continual enforcement of safety protocols until manual deactivation, reaffirming its sole purpose for microcontroller operations.
-
URL:
https://industrialiot.onrender.com/api/emergency
-
Method:
PUT
-
Headers:
-
Content-Type:
application/json
-
Content-Type:
- Body Parameters:
Parameter | Type | Description |
---|---|---|
emergency |
String | Emergency state (required) |
-
Success Response:
- Status Code: 200 OK
-
Response Body:
{ "success": "Broadcast successful" }
- Description: Indicates successful broadcasting of the emergency state to update the web interface.
On actuating the emergency pushbutton connected to the microcontroller, the server emits a socket message to connected clients with the following information:
-
Socket Message: emergency
-
Payload:
{ "emergency": "<EMERGENCY_STATUS>" }
-
Request Method:
PUT
-
Endpoint URL:
https://industrialiot.onrender.com/api/emergency
-
Header:
Content-Type: application/json
-
Request Body:
{ "emergency": "<CURRENT_STATE>" }
Note: The
emergency
field within the request body should strictly contain either0
or1
to signify the current emergency state.