Jan Romann
4384795cb9
treewide: Remove excessive newlines
2021-08-13 19:50:38 +02:00
Martine Lenders
febb07c64e
Merge pull request #16704 from fjmolinas/pr_block_finish_return_more
...
sys/net/nanocoap: block_finish returns if more are expected
2021-08-12 19:16:46 +02:00
Francisco Molina
9195f772ad
sys/net/nanocoap: block_finish returns if more are expected
2021-08-06 09:29:03 +02:00
Martine Lenders
adce90343c
nanocoap: provide buffer version of coap_opt_add_uri_path()
...
This simplifies the usage of `nanocoap` with modules such as
`uri_parser` greatly.
2021-08-05 11:25:13 +02:00
Martine Lenders
3cff67ce13
nanocoap: provide Accept option convenience function
2021-07-23 15:25:41 +02:00
Benjamin Valentin
d4e5c25b70
nanocoap: add coap_opt_put_uri_pathquery()
2021-02-23 18:27:54 +01:00
Benjamin Valentin
b24480538a
nanocoap: add coap_opt_put_string_with_len()
2021-01-21 15:17:28 +01:00
Cenk Gündoğan
7d820f7ada
nanocoap: gcoap: use const parameter for coap_method2flag
2020-10-28 15:40:35 +01:00
Ken Bannister
10a479c1c5
Merge pull request #13935 from cgundogan/pr/nanocoap/proxy_uri_parsing
...
nanocoap: add coap_get_proxy_uri()
2020-05-07 06:14:19 -04:00
Ken Bannister
595e8c631f
Merge pull request #13726 from benpicco/nanocoap-payload_helper
...
nanocoap: add payload helper functions
2020-05-03 08:56:30 -04:00
Benjamin Valentin
e5c20b143d
nanocoap: add coap_payload_put_char()
2020-05-01 13:58:22 +02:00
Benjamin Valentin
2751708341
nanocoap: add payload helper functions
...
This adds two functions `coap_payload_add()` and `coap_payload_advance()`.
- `coap_payload_add()` will add n bytes to the payload buffer and advance
payload pointer accordingly.
const char hello[] = "Hello CoAP!";
coap_payload_add(pkt, hello, sizeof(hello));
- `coap_payload_advance()` will advance the payload buffer after data
has been added to it.
int len = snprintf(pkt->payload, pkt->payload_len, "%s %s!", "Hello", "CoAP");
coap_payload_advance(pkt, len);
I considered adding an additional parameter to keep track of the total request size
(returned size from coap_opt_finish() incremented by each added payload fragment),
but decided against it to keep consistency with the existing API.
2020-05-01 13:58:22 +02:00
Cenk Gündoğan
4e05a66ca2
nanocoap: add proxy_uri parsing
2020-04-23 22:41:12 +02:00
Cenk Gündoğan
ea616abfda
nanocoap: allow coap_opt_add_string() for zero-terminated strings
2020-04-22 12:28:48 +02:00
Cenk Gündoğan
6859de7855
nanocoap: export coap_opt_get_uint()
2020-04-17 22:39:44 +02:00
14706d7423
Merge pull request #13243 from leandrolanzieri/pr/kconfig_migrate/net/nanocoap
...
net/nanocoap: Expose configurations to Kconfig
2020-04-08 10:51:54 +02:00
Ken Bannister
1ff78879ff
net/nanocoap: remove obsolete functions to add Uri-Query option
2020-04-07 12:17:41 -04:00
Leandro Lanzieri
b6be8af81c
net/nanocoap: Move NANOCOAP_QS_MAX to 'CONFIG_' namespace
2020-04-07 17:00:53 +02:00
Leandro Lanzieri
2f72189aa2
net/nanocoap: Move NANOCOAP_BLOCK_SIZE_EXP_MAX to 'CONFIG_' namespace
2020-04-07 17:00:53 +02:00
Leandro Lanzieri
4052c01e85
net/nanocoap: Move NANOCOAP_URI_MAX to 'CONFIG_' namespace
2020-04-07 17:00:53 +02:00
Leandro Lanzieri
c84576ef6e
net/nanocoap: Move NANOCOAP_NOPTS_MAX to 'CONFIG_' namespace
2020-04-07 17:00:52 +02:00
Ken Bannister
b32fcd28d1
Merge pull request #13815 from kb2ma/nanocoap/add_canonical_uri_query
...
net/gcoap: add canonical uri query function names
2020-04-07 06:32:13 -04:00
Ken Bannister
d57340c964
net/nanocoap: use new Uri-Query functions as primary implementation
2020-04-06 06:19:44 -04:00
Benjamin Valentin
1a4a5d4a9e
nanocoap: add convenience function for adding path elements
...
Add a convenience function to make adding additional sub-path
options easier.
2020-04-04 17:06:04 +02:00
Ken Bannister
c463c45939
net/nanocoap: add canonical function names to add Uri-Query option
2020-04-04 07:56:58 -04:00
Cenk Gündoğan
50900a1fbe
nanocoap: add convenience function for PROXY_URI
2020-03-28 14:50:51 +01:00
Cenk Gündoğan
5e42e26a6e
nanocoap: add const qualifier to pkt of coap_opt_get_opaque()
2020-03-25 13:38:21 +01:00
1d5010e126
nanocoap: make separate tree handling function
...
This refactors nanocoap to seperate out the resource tree parsing. It
allows for calling the tree handler with custom resource trees. The
advantage is that a resource with COAP_MATCH_SUBTREE can parse a new
separate resource tree.
2020-03-23 15:08:53 +01:00
Ken Bannister
e6b20b4ce7
net/nanocoap: Fix return value doc for coap_opt_add_uqueryX()
2020-03-12 08:44:26 -04:00
Aiman Ismail
64f9658472
nanocoap: add coap_opt_add_uquery2()
2020-03-05 19:06:14 +01:00
chrysn
83c889320d
nanocoap: State handler idempotentcy requirement
...
Closes: https://github.com/RIOT-OS/RIOT/issues/12938
2020-02-11 11:12:08 +01:00
Ken Bannister
0ed4fe2da6
net/coap: move/rename function to add query option
2020-01-29 09:23:47 -05:00
Francois Berder
4a31f94cfc
many typo fixes
...
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
1aa1e2c8cc
sys/net/nanocoap: return ENOENT if parsing option failed
...
This fixes a potential use of uninitialized len in subsequent function calls.
This was reported by scan-build
2019-10-30 17:03:06 +01:00
Ken Bannister
fe8bb49e39
Merge pull request #12231 from kb2ma/coap/refine_api_purpose
...
net/nanocoap: rebalance application vs. option API doc
2019-10-15 18:25:50 -04:00
Ken Bannister
2abcbc0d20
net/coap: add generic get block function
2019-10-02 05:51:59 -04:00
Ken Bannister
5eaa51e426
net/nanocoap: remove unused function
2019-10-02 05:51:59 -04:00
Ken Bannister
dae9c4ab89
net/nanocoap: use coap_opt_add_uint() and remove unused
2019-10-02 05:51:59 -04:00
Ken Bannister
233dd31e17
net/nanocoap: add generic uint block option
2019-10-02 05:51:59 -04:00
benpicco
e942f86837
Merge pull request #11056 from kb2ma/coap/pkt_api_block_write
...
net/gcoap: add/use Packet API Block implementation
2019-09-24 21:43:33 +02:00
Ken Bannister
d9d8d92429
net/nanocoap: reinsert doc to add options in order
2019-09-15 05:37:26 -04:00
Ken Bannister
0c5706969c
net/nanocoap: refactor Options API doc
2019-09-14 10:56:38 -04:00
Ken Bannister
55c18947bd
net/nanocoap: doc emphasize application API
2019-09-14 08:13:50 -04:00
Ken Bannister
39eddce078
net/nanocoap: add function to retrieve opaque option
2019-09-11 05:40:14 -04:00
Sebastian Meiling
9f5951d216
Merge pull request #10214 from bergzand/pr/nanocoap/flags_uint32t
...
nanocoap: change method flag type to uint16_t
2019-09-09 12:33:17 +03:00
Sebastian Meiling
c78ae0e33c
Merge pull request #12074 from kb2ma/coap/options_iterate
...
net/nanocoap: iterate options
2019-09-09 10:51:23 +03:00
4d399bf444
nanocoap: change method flag type to uint32_t
2019-09-09 09:40:14 +02:00
7bd9e68867
nanocoap: Add method flags for rfc8132
2019-09-05 13:00:22 +02:00
Ken Bannister
4e89741b79
net/nanocoap: add function to iterate over options
2019-08-24 06:51:29 -04:00
Ken Bannister
78ea07d5e7
net/nanocoap: make coap_pkt_t param const
2019-08-21 13:20:49 -04:00