CH340 Sonic Sensor Driver API Information
1. Open Sonic
Description:This API can be used to open supersonic sensor.
URI: /sonic/controller
Method: PUT
Header: Authrization: {token}
Body:
Return: 200 ("success")
Error: 500 ("open sensor connection failed")
2. Close Sonic
Description:This API can be used to close supersonic sensor.
URI: /sonic/controller
Method: DELETE
Header: Authrization: {token}
Body:
Return: 200 ("success")
Error: 500 ("close sensor connection failed")
3. Measure Distance
Description:This API can be used to measure distance with supersonic sensor.
URI: /sonic/measure
Method: POST
Header: Authrization: {token}
Body:
Return: 200 {"distance": distance}
Error: 500 ("measure distance with sonic sensor failed")
4. Start Looping Measure Distance
Description:This API can be used to start looping measure distance with supersonic sensor.
URI: /sonic/measures
Method: PUT
Header: Authrization: {token}
Body: 200 {"looptime": looptime}
Return: 200 ("success")
Error: 500 (start measure looping with sonic sensor failed)
5. Stop Looping Measure Distance
Description:This API can be used to stop looping measure distance with supersonic sensor.
URI: /sonic/measures
Method: DELETE
Header: Authrization: {token}
Body:
Return: 200 ("success")
Error: 500 (stop measure looping with sonic sensor failed)
6. Get Looping Measure Distance
Description:This API can be used to get looping measure distance with supersonic sensor.
URI: /sonic/measure
Method: GET
Header: Authrization: {token}
Body:
Return: 200 {"distance": distance}
Error: 500 ("get measure distance from measure looping failed")