CoRE Resource Directory endpoint using the simple registration procedure.
More...
CoRE Resource Directory endpoint using the simple registration procedure.
This module is designed to provide nodes with the possibility to register with resource directories without having to allocate a lot of resources. All the user has to do, is to call the cord_epsim_register() function in periodic intervals, depending on the value of the CONFIG_CORD_LT
variable.
|
file | epsim.h |
| Interface for the CoRE RD simple registration endpoint.
|
|
◆ anonymous enum
Error codes used by the cord_epsim implementation.
Enumerator |
---|
CORD_EPSIM_OK | all good
|
CORD_EPSIM_ERROR | on failing to send POST request
|
CORD_EPSIM_BUSY | endpoint registration is in progress
|
Definition at line 40 of file epsim.h.
◆ cord_epsim_register()
Initiate the node registration by sending an empty CoAP POST message to the RD server's /.well-known/core resource.
- Precondition
- remote != NULL
- Parameters
-
[in] | remote | address and port of the target resource directory |
- Returns
- CORD_EPSIM_OK on success
-
CORD_EPSIM_BUSY if registration is already in progress
-
CORD_EPSIM_ERROR if something goes wrong preparing or sending the registration request
◆ cord_epsim_state()
int cord_epsim_state |
( |
void |
| ) |
|
Get the status of the latest registration procedure.
- Returns
- CORD_EPSIM_OK if last registration was triggered successfully
-
CORD_EPSIM_BUSY if a registration is currently in progress
-
CORD_EPSIM_ERROR if latest registration attempt failed