mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
Fix mongoose docs generation
PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
This commit is contained in:
1 parent
ab000c684a
commit
3eb4eb8074
166 files changed
+3125
No files matched your search
@@ -0,0 +1,26 @@
|
||||
---
|
||||
title: "CoAP API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "mg_coap.h"
|
||||
items:
|
||||
- { name: mg_coap_add_option.md }
|
||||
- { name: mg_coap_compose.md }
|
||||
- { name: mg_coap_free_options.md }
|
||||
- { name: mg_coap_parse.md }
|
||||
- { name: mg_coap_send_ack.md }
|
||||
- { name: mg_coap_send_message.md }
|
||||
- { name: mg_set_protocol_coap.md }
|
||||
- { name: struct_mg_coap_message.md }
|
||||
- { name: struct_mg_coap_option.md }
|
||||
---
|
||||
|
||||
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) ...
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
||||
```
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "mg_coap_add_option()"
|
||||
decl_name: "mg_coap_add_option"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
struct mg_coap_option *mg_coap_add_option(struct mg_coap_message *cm,
|
||||
uint32_t number, char *value,
|
||||
size_t len);
|
||||
---
|
||||
|
||||
Adds a new option to mg_coap_message structure.
|
||||
Returns pointer to the newly created option.
|
||||
Note: options must be freed by using mg_coap_free_options
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "mg_coap_compose()"
|
||||
decl_name: "mg_coap_compose"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
uint32_t mg_coap_compose(struct mg_coap_message *cm, struct mbuf *io);
|
||||
---
|
||||
|
||||
Composes CoAP message from mg_coap_message structure.
|
||||
This is a helper function.
|
||||
Return value: see `mg_coap_send_message()`
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: "mg_coap_free_options()"
|
||||
decl_name: "mg_coap_free_options"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_coap_free_options(struct mg_coap_message *cm);
|
||||
---
|
||||
|
||||
Frees the memory allocated for options.
|
||||
If the cm parameter doesn't contain any option it does nothing.
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "mg_coap_parse()"
|
||||
decl_name: "mg_coap_parse"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
uint32_t mg_coap_parse(struct mbuf *io, struct mg_coap_message *cm);
|
||||
---
|
||||
|
||||
Parses CoAP message and fills mg_coap_message and returns cm->flags.
|
||||
This is a helper function.
|
||||
|
||||
NOTE: usually CoAP works over UDP, so lack of data means format error.
|
||||
But, in theory, it is possible to use CoAP over TCP (according to RFC)
|
||||
|
||||
The caller has to check results and treat COAP_NOT_ENOUGH_DATA according to
|
||||
underlying protocol:
|
||||
|
||||
- in case of UDP COAP_NOT_ENOUGH_DATA means COAP_FORMAT_ERROR,
|
||||
- in case of TCP client can try to receive more data
|
||||
|
||||
Return value: see `mg_coap_send_message()`
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "mg_coap_send_ack()"
|
||||
decl_name: "mg_coap_send_ack"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
uint32_t mg_coap_send_ack(struct mg_connection *nc, uint16_t msg_id);
|
||||
---
|
||||
|
||||
Composes CoAP acknowledgement from `mg_coap_message`
|
||||
and sends it into `nc` connection.
|
||||
Return value: see `mg_coap_send_message()`
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "mg_coap_send_message()"
|
||||
decl_name: "mg_coap_send_message"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
uint32_t mg_coap_send_message(struct mg_connection *nc,
|
||||
struct mg_coap_message *cm);
|
||||
---
|
||||
|
||||
Composes a CoAP message from `mg_coap_message`
|
||||
and sends it into `nc` connection.
|
||||
Returns 0 on success. On error, it is a bitmask:
|
||||
|
||||
- `#define MG_COAP_ERROR 0x10000`
|
||||
- `#define MG_COAP_FORMAT_ERROR (MG_COAP_ERROR | 0x20000)`
|
||||
- `#define MG_COAP_IGNORE (MG_COAP_ERROR | 0x40000)`
|
||||
- `#define MG_COAP_NOT_ENOUGH_DATA (MG_COAP_ERROR | 0x80000)`
|
||||
- `#define MG_COAP_NETWORK_ERROR (MG_COAP_ERROR | 0x100000)`
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_set_protocol_coap()"
|
||||
decl_name: "mg_set_protocol_coap"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_set_protocol_coap(struct mg_connection *nc);
|
||||
---
|
||||
|
||||
Sets CoAP protocol handler - triggers CoAP specific events.
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "struct mg_coap_message"
|
||||
decl_name: "struct mg_coap_message"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_coap_message {
|
||||
uint32_t flags;
|
||||
uint8_t msg_type;
|
||||
uint8_t code_class;
|
||||
uint8_t code_detail;
|
||||
uint16_t msg_id;
|
||||
struct mg_str token;
|
||||
struct mg_coap_option *options;
|
||||
struct mg_str payload;
|
||||
struct mg_coap_option *optiomg_tail;
|
||||
};
|
||||
---
|
||||
|
||||
CoAP message. See RFC 7252 for details.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "struct mg_coap_option"
|
||||
decl_name: "struct mg_coap_option"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_coap_option {
|
||||
struct mg_coap_option *next;
|
||||
uint32_t number;
|
||||
struct mg_str value;
|
||||
};
|
||||
---
|
||||
|
||||
CoAP options.
|
||||
Use mg_coap_add_option and mg_coap_free_options
|
||||
for creation and destruction.
|
||||
|
||||
Reference in new issue
Block a user