mongoose/docs/c-api/coap.h/mg_coap_parse.md
Dmitry Frank 7bed7ff482 Docs are generated for Mongoose
Comments in headers are changed a bit: removed adoc-specific stuff,
markdown is used instead

PUBLISHED_FROM=9242cce85cc52a47a197d377e7e23804721a6bb5
2016-03-21 13:29:29 +01:00

23 lines
662 B
Markdown

---
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);
---
Parse COAP message and fills mg_coap_message and returns cm->flags.
This is a helper function.
NOTE: usually CoAP work 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 have 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()`