chrysn
462f8861f4
gcoap: Suppress retransmissions when ACK was received
...
This introduces an additional state to the COAP_MEMO_* series to avoid
enlarging the memo struct needlessly. While they are documented
publicly, practically only the COAP_MEMO_TIMEOUT and COAP_MEMO_RESPONSE
are used in communication with the application, as a
gcoap_request_memo_t is only handed out in that state.
2020-10-22 19:08:39 +02:00
chrysn
f32d758819
gcoap: Prepare to cease retransmission
...
The actual implementation will follow in a separate commit, this does
the groundwork and sets the intention.
2020-10-22 19:08:39 +02:00
chrysn
0a2f97680f
gcoap: Cleanup around empty responses
...
Simplify the code path and give consistent debug messages.
2020-10-22 19:08:39 +02:00
chrysn
ff00d66d69
gcoap: Process CON responses
...
This generalizes the existing code for answering CoAP pings into general
message-layer responses. Such responses are now also sent as a reaction
to CON responses, which can otherwise follow the same code path as
existing other responses.
As a side effect, issues that would crop up when responding to odd empty
requests that have token length set are resolved.
Contributes-To: https://github.com/RIOT-OS/RIOT/issues/14169
2020-10-22 19:08:39 +02:00
chrysn
6350d22bc9
net/gcoap: Register additional resources head-first
...
This simplifies (written and compiled) code by doing a head rather than
a tail insertion of the new listener into gcoap's list.
As handling of listeners without a link_encoder is now fixed,
gcoap_get_resource_list can handles this now without having to manually
skip over the .well-known/core handler (which is not the first entry any
more now).
Incidentally, this allows the user to install a custom handler for
.well-known/core, as the default handler is now evaluated last.
2020-10-02 21:04:25 +02:00
chrysn
e3db58f013
net/gcoap: Avoid endless loop on error
...
The NULL case can not regularly be reached (because regularly
gcoap_register_listener sets thel link_encoder to a default one), but if
it is (eg. because an application unsets its link_encoder to hide a
resource set at runtime), the existing `continue` is a good idea (skip
over this entry) but erroneously created an endless loop by skipping the
advancement step.
2020-10-02 20:53:05 +02:00
Leandro Lanzieri
d25fc243c4
treewide: change prefix for generated Kconfig symbols.
...
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:
KCONFIG_MODULE_ => KCONFIG_USEMODULE_
KCONFIG_PKG_ => KCONFIG_USEPKG_
MODULE_ => USEMODULE_
PKG_ => USEPKG_
2020-08-31 09:37:09 +02:00
Leandro Lanzieri
3920dd8c20
net/gcoap: Remove gcoap_finish
2020-07-17 16:33:19 +02:00
Leandro Lanzieri
9e427e1584
net/coap: Move COAP_MAX_RETRANSMIT to 'CONFIG' namespace
...
COAP_MAX_RETRANSMIT is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:43 +02:00
Leandro Lanzieri
afe4244ac9
net/coap: Move COAP_RANDOM_FACTOR_1000 to 'CONFIG' namespace
...
COAP_RANDOM_FACTOR_1000 is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:43 +02:00
Leandro Lanzieri
072a0d8563
net/coap: Move COAP_ACK_TIMEOUT to 'CONFIG' namespace
...
COAP_ACK_TIMEOUT is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:40 +02:00
Ken Bannister
6eae4ded84
net/gcoap: create CoAP ping request
2020-04-17 08:15:20 -04:00
Ken Bannister
f5a85e2aff
net/gcoap: handle CoAP ping request
2020-04-17 08:15:20 -04:00
Leandro Lanzieri
b6be8af81c
net/nanocoap: Move NANOCOAP_QS_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
Benjamin Valentin
c8b2483de5
net/gcoap: make use of coap_opt_add_path()
2020-04-04 17:06:04 +02:00
Martine S. Lenders
411e320b0c
sock_async_event: update for async callback argument support
2020-03-11 16:54:12 +01:00
Martine S. Lenders
6e6e435c65
sock_async: add optional callback argument
2020-03-11 16:54:11 +01:00
Ken Bannister
e98a6e5932
net/gcoap: update copyright date
2020-02-24 06:22:04 -05:00
Ken Bannister
c8cd3f0229
net/gcoap: fix vera++ code style warnings
2020-02-24 06:20:43 -05:00
Ken Bannister
9b63abb718
net/gcoap: cast required for pic32 platform
...
Fixes bug found during rework for sock_async implementation.
2020-02-22 05:46:07 -05:00
Ken Bannister
0dc1e4c4e7
net/gcoap: fix when no timeout event
...
Fixes bug found during rework for sock_async implementation.
2020-02-22 05:46:07 -05:00
Ken Bannister
d6fa3c7c2f
net/gcoap: add timeout event/handler for server response
2020-02-16 09:17:48 -05:00
Ken Bannister
ea62734baf
net/gcoap: add sock_async event handling
...
Rework from earlier custom event/msg handling.
2020-02-16 09:17:48 -05:00
Cenk Gündoğan
c84d7d2623
Merge pull request #12887 from leandrolanzieri/pr/kconfig_migrate/gcoap
...
Kconfig: Expose Gcoap configurations
2020-01-28 18:58:29 +01:00
Leandro Lanzieri
926d32ff30
Kconfig: Expose Gcoap configurations
2020-01-28 11:59:52 +01:00
Leandro Lanzieri
bab6f4737c
net/gcoap: Move config macros to 'CONFIG_' namespace
...
Macros that changed:
GCOAP_MSG_QUEUE_SIZE -> CONFIG_GCOAP_MSG_QUEUE_SIZE
GCOAP_NO_AUTO_INIT -> CONFIG_GCOAP_NO_AUTO_INIT
GCOAP_NO_RETRANS_BACKOFF -> CONFIG_GCOAP_NO_RETRANS_BACKOFF
GCOAP_NON_TIMEOUT -> CONFIG_GCOAP_NON_TIMEOUT
GCOAP_OBS_CLIENTS_MAX -> CONFIG_GCOAP_OBS_CLIENTS_MAX
GCOAP_OBS_OPTIONS_BUF -> CONFIG_GCOAP_OBS_OPTIONS_BUF
GCOAP_OBS_REGISTRATIONS_MAX -> CONFIG_GCOAP_OBS_REGISTRATIONS_MAX
GCOAP_OBS_VALUE_WIDTH -> CONFIG_GCOAP_OBS_VALUE_WIDTH
GCOAP_PDU_BUF_SIZE -> CONFIG_GCOAP_PDU_BUF_SIZE
GCOAP_PORT -> CONFIG_GCOAP_PORT
GCOAP_RECV_TIMEOUT -> CONFIG_GCOAP_RECV_TIMEOUT
GCOAP_REQ_OPTIONS_BUF -> CONFIG_GCOAP_REQ_OPTIONS_BUF
GCOAP_REQ_WAITING_MAX -> CONFIG_GCOAP_REQ_WAITING_MAX
GCOAP_RESEND_BUFS_MAX -> CONFIG_GCOAP_RESEND_BUFS_MAX
GCOAP_RESP_OPTIONS_BUF -> CONFIG_GCOAP_RESP_OPTIONS_BUF
GCOAP_TOKENLEN -> CONFIG_GCOAP_TOKENLEN
2020-01-28 11:59:52 +01:00
Leandro Lanzieri
3f382dc323
net/gcoap: Use COAP_RANDOM_FACTOR_1000 to calculate timeout range
...
With this the range for the random timeout is calculated using
COAP_RANDOM_FACTOR_1000 (ACK_RANDOM_FACTOR in RFC 7252).
2020-01-27 19:47:20 +01:00
Hauke Petersen
3fd8357071
net/gcoap: allow to pass user context to requests
2019-11-28 12:50:24 +01:00
Hauke Petersen
383f395af3
net/gcoap: pass memo to resp_handler directly
2019-11-28 12:48:37 +01:00
Hauke Petersen
17b1b19fda
net/gcoap: do not allocate RX buf on stack
2019-11-26 15:00:03 +01:00
d4f3747705
sys/net: fix typos
2019-11-23 22:39:38 +01:00
bde253cca3
gcoap: use coap_method_flags_t
2019-09-09 09:40:14 +02:00
Benjamin Valentin
e8dc1119b8
sys: make use of ARRAY_SIZE macro
2019-08-06 19:43:54 +02:00
Ken Bannister
c8e87e7854
Merge pull request #11787 from miri64/gcoap/enh/backoff-config
...
gcoap: allow for retransmission backoff to be turned off
2019-08-02 06:40:07 -04:00
Ken Bannister
28317019fc
Merge pull request #11784 from miri64/gcoap/fix/ack-variance-0
...
gcoap: don't call random_uint32_range() when COAP_ACK_VARIANCE=0
2019-08-02 05:10:45 -04:00
Leandro Lanzieri
a9ab9d37e2
Merge pull request #11765 from kb2ma/coap/encode_resources
...
net/gcoap: add/publish link format attributes for a resource
2019-07-27 22:36:33 +02:00
Ken Bannister
d481ca9da7
net/gcoap: add selectable function to write a link
2019-07-27 07:09:40 -04:00
Martine S. Lenders
c31c9ed216
gcoap: allow for retransmission backoff to be turned off
2019-07-03 16:35:48 +02:00
Martine S. Lenders
1bde141697
gcoap: don't call random_uint32_range() when COAP_ACK_VARIANCE=0
...
`COAP_ACK_VARIANCE` is a configurable macro, so when it is 0, the
[precondition for `random_uint32_range()`][1] is not held.
[1]: https://doc.riot-os.org/group__sys__random.html#gab6ee09e1e56df3cc78acd1fbf97bfb24
2019-07-03 15:45:45 +02:00
Martine S. Lenders
c9179a26c8
gcoap: replace internal references to gcoap_req_send2()
...
`gcoap_req_send2()` is deprecated and was replaced with
`gcoap_req_send()`.
2019-07-03 15:00:06 +02:00
Martine Lenders
a11f817604
gcoap: rename gcoap_req_send2() to gcoap_req_send()
2019-04-25 13:40:32 +02:00
Martine Lenders
affd115405
gcoap: remove deprecated function gcoap_req_send()
2019-04-25 13:39:50 +02:00
88171698e0
Merge pull request #10931 from kb2ma/nanocoap/pktapi_opt_enospc
...
net/nanocoap: Packet API return error if buffer full
2019-04-03 14:49:44 +02:00
Ken Bannister
3cdf43607c
net/nanocoap: Return error from coap_opt_add_xxx() if no space
2019-03-19 05:30:04 -04:00
Leandro Lanzieri
6bb4158c31
sys/net/application_layer/nanocoap: Add path prefix opt
...
This adds a prefix option for the methods field of a coap resource and
modifies the way the path is matched on a request to accept prefix
matching.
2019-03-17 14:26:11 +01:00
Ken Bannister
93da7372fd
net/gcoap: use coap_opt_finish within gcoap
2019-01-27 08:56:26 -05:00
Ken Bannister
0e1c3ebe50
net/gcoap: make options buf macros configurable
2019-01-16 12:41:06 -05:00
Ken Bannister
bec94b0b7a
net/gcoap: allow NULL path in gcoap_req_init()
2018-11-28 13:20:22 -05:00
Ken Bannister
424a01ddc1
net/gcoap: remove gcoap attributes from coap_pkt_t
2018-11-24 07:09:25 -05:00