2016-05-12 04:36:12 +08:00
|
|
|
---
|
2016-09-01 22:19:01 +08:00
|
|
|
title: "CoAP API reference"
|
2016-05-12 04:36:12 +08:00
|
|
|
symbol_kind: "intro"
|
|
|
|
decl_name: "coap.h"
|
2016-05-26 18:30:13 +08:00
|
|
|
items:
|
2016-09-01 22:19:01 +08:00
|
|
|
- { name: mg_coap_add_option.md }
|
2016-10-26 16:01:25 +08:00
|
|
|
- { name: mg_coap_compose.md }
|
2016-09-01 22:19:01 +08:00
|
|
|
- { name: mg_coap_free_options.md }
|
|
|
|
- { name: mg_coap_parse.md }
|
2016-10-26 16:01:25 +08:00
|
|
|
- { name: mg_coap_send_ack.md }
|
|
|
|
- { name: mg_coap_send_message.md }
|
|
|
|
- { name: mg_set_protocol_coap.md }
|
2016-09-01 22:19:01 +08:00
|
|
|
- { name: struct_mg_coap_message.md }
|
2016-10-26 16:01:25 +08:00
|
|
|
- { name: struct_mg_coap_option.md }
|
2016-05-12 04:36:12 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
CoAP message format:
|
|
|
|
|
|
|
|
```
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
|Ver| T | TKL | Code | Message ID | Token (if any, TKL bytes) ...
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
| Options (if any) ... |1 1 1 1 1 1 1 1| Payload (if any) ...
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
```
|
|
|
|
|