Manages context identifiers and prefixes related to the identifiers.
More...
Manages context identifiers and prefixes related to the identifiers.
This module allows to handle context information throughout the IoT application. The module is used in the compression and decompression procedures of IPv6 addresses. It allows more efficient communication between two nodes using global addresses. The Context Manager contains tables of context, which can be accessed through API functions. The table is mainatined by the IPv6 stack while is referenced by 6LoWPAN module to be able to compress and decompress paackets.
You can configure the module by changing the sdk_config.h
configuration file.
Function for searching the proper entry in the context table by IPv6 address. Only contexts with compression flag set to true, may be returned.
- Parameters
-
[in] | p_interface | Pointer to the IoT interface. |
[in] | p_addr | Pointer to IPv6 address to be compared with records in the context table. |
[out] | pp_context | Pointer to the context in the context table. |
- Return values
-
NRF_SUCCESS | If the procedure succeeded. Otherwise, an error code that indicates the reason for the failure is returned. |
Function for searching the proper entry in the context table by context identifier.
- Parameters
-
[in] | p_interface | Pointer to the IoT interface. |
[in] | context_id | Context identifier to be compared with records in the context table. |
[out] | pp_context | Pointer to the context in the context table. |
- Return values
-
NRF_SUCCESS | If the procedure succeeded. Otherwise, an error code that indicates the reason for the failure is returned. |
uint32_t iot_context_manager_init |
( |
void |
| ) |
|
Function for initializing the module.
- Return values
-
NRF_SUCCESS | If the module was successfully initialized. Otherwise, an error code that indicates the reason for the failure is returned. |
Function for removing context from the context table.
- Parameters
-
- Return values
-
NRF_SUCCESS | If the context was successfully removed. Otherwise, an error code that indicates the reason for the failure is returned. |
uint32_t iot_context_manager_table_alloc |
( |
const iot_interface_t * |
p_interface | ) |
|
Function for allocating the table for the specific interface.
- Parameters
-
[in] | p_interface | Pointer to the IoT interface. |
- Return values
-
NRF_SUCCESS | If the table was successfully allocated. Otherwise, an error code that indicates the reason for the failure is returned. |
uint32_t iot_context_manager_table_free |
( |
const iot_interface_t * |
p_interface | ) |
|
Function for freeing the table for the specific interface.
- Parameters
-
[in] | p_interface | Pointer to the IoT interface. |
- Return values
-
NRF_SUCCESS | If the table was successfully freed. Otherwise, an error code that indicates the reason for the failure is returned. |
Function for updating the context table.
Update requests are treated as follows:
- If the context identifier already exists in the context table, the context is updated.
- If the context identifier does not exist yet, a new entry is generated. If no memory is available, NRF_ERROR_NO_MEMORY is returned.
The compression flag indicates if a context can be used for compression. The context table can hold up to 16 context's information.
- Parameters
-
[in] | p_interface | Pointer to the IoT interface. |
[in] | p_context | Pointer to the context entry that shall be modified or added. |
- Return values
-
NRF_SUCCESS | If the table was successfully updated. Otherwise, an error code that indicates the reason for the failure is returned. |