GATT REST API
2021-03-31 11:03:13 8 举报
AI智能生成
GATT REST API White Paper
作者其他创作
大纲/内容
Characteristic Value
Read
Requests
Read Value
GET http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>/value
Read Value By UUID
GET http://<gateway>/gatt/nodes/<node>/characteristics/value?uuid=<uuid>&start=<handle>&end=<handle>
Read the long value
GET http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>/value?long=1
Responses
200 - OK
400 - Bad Request
403 – Forbidden
404 - Not Found
412 – Precondition failed
504 – Not able to connect
Multiple Read
Read the Multiple Value of Characteristics
GET http://<gateway>/gatt/nodes/<node>/characteristics/value?multiple=1
Cached Indicated or Notified Read
Read the Latest Cached Indicated Value
GET http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>/value?indicate=1
Read the Latest Cached Notified Value
GET http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>/value?notify=1
Write
Write Value
PUT http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>/value/<value>
Write the Long Value
PUT http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>/value/<value>?long=1
Write Without Response
PUT http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>/value/<value>?noresponse=1
405 – Method not allowed
Reliable Write
PUT http://<gateway>/gatt/nodes/<node>/characteristics/value?reliable=1
415 – Unsupported Media Type
Characteristic Descriptors
Discover All Descriptors
GET http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>/descriptors
Read Data
GET http://<gateway>/gatt/nodes/<node>/descriptors/<descriptor>
Characteristic Descriptor Value
Read value
GET http://<gateway>/gatt/nodes/<node>/descriptors/<descriptor>/value
Write value
PUT http://<gateway>/gatt/nodes/<node>/descriptors/<descriptor>/value/<value>
Write long value
PUT http://<gateway>/gatt/nodes/<node>/descriptors/<descriptor>/value/<value>?long=1
GATT REST API
Nodes
Request
Read data for a specific node
GET http://<gateway>/gatt/nodes/<node>
List Available Nodes
GET http://<gateway>/gatt/nodes
Services
Discover All Services
GET http://<gateway>/gatt/nodes/<node>/services
Discover All Primary Services
GET http://<gateway>/gatt/nodes/<node>/services?primary=1
Discover Primary Services By UUID
GET http://<gateway>/gatt/nodes/<node>/services?primary=1&uuid=<uuid>
Read Data for a Service
GET http://<gateway>/gatt/nodes/<node>/services/<service>
Characteristics
Discovery
Discover All Characteristics
GET http://<gateway>/gatt/nodes/<node>/services/<service>/characteristics
Discover Characteristics By UUID
GET http://<gateway>/gatt/nodes/<node>/characteristics?uuid=<uuid>
Get Data for a Characteristic
GET http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>
Indication and Notification
Enable Indication
PUT http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>?indicate=1
Disable Indication
PUT http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>?indicate=0
Enable Notification
PUT http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>?notify=1
Disable Notification
PUT http://<gateway>/gatt/nodes/<node>/characteristics/<characteristic>?notify=0
General error returns
406 – Not acceptable
0 条评论
下一页