Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510
thread_meshcop_lib.h File Reference
Public API to handle the Thread management framework message parsing and building. More...
Go to the source code of this file.
Functions | |
uint8_t * | thread_meshcop_tlv_data_write (uint8_t *ptr, const uint8_t type, const uint16_t length, const uint8_t *data) |
Write array TLV. | |
uint8_t * | thread_meshcop_tlv_data_write_header (uint8_t *ptr, uint8_t type, uint16_t length) |
Write header. | |
uint8_t * | thread_meshcop_tlv_data_write_uint8 (uint8_t *ptr, const uint8_t type, const uint8_t data) |
Write 1 byte length TLV. | |
uint8_t * | thread_meshcop_tlv_data_write_uint16 (uint8_t *ptr, const uint8_t type, const uint16_t data) |
Write 2 byte length TLV. | |
uint8_t * | thread_meshcop_tlv_data_write_uint32 (uint8_t *ptr, const uint8_t type, const uint32_t data) |
Write 4 byte length TLV. | |
uint8_t * | thread_meshcop_tlv_data_write_uint64 (uint8_t *ptr, const uint8_t type, const uint64_t data) |
Write 8 byte length TLV. | |
bool | thread_meshcop_tlv_exist (const uint8_t *ptr, const uint16_t length, const uint8_t type) |
Check if TLV exists in the message. | |
uint16_t | thread_meshcop_tlv_find (const uint8_t *ptr, const uint16_t length, const uint8_t type, uint8_t **result_ptr) |
Find TLV from message. | |
uint8_t | thread_meshcop_tlv_data_get_uint8 (const uint8_t *ptr, const uint16_t length, const uint8_t type, uint8_t *data_ptr) |
Read 1 byte length TLV. | |
uint8_t | thread_meshcop_tlv_data_get_uint16 (const uint8_t *ptr, const uint16_t length, const uint8_t type, uint16_t *data_ptr) |
Read 2 byte length TLV. | |
uint8_t | thread_meshcop_tlv_data_get_uint32 (const uint8_t *ptr, const uint16_t length, const uint8_t type, uint32_t *data_ptr) |
Read 4 byte length TLV. | |
uint8_t | thread_meshcop_tlv_data_get_uint64 (const uint8_t *ptr, const uint16_t length, const uint8_t type, uint64_t *data_ptr) |
Read 8 byte length TLV. |
Detailed Description
Public API to handle the Thread management framework message parsing and building.
Definition in file thread_meshcop_lib.h.
Function Documentation
uint8_t thread_meshcop_tlv_data_get_uint16 | ( | const uint8_t * | ptr, |
const uint16_t | length, | ||
const uint8_t | type, | ||
uint16_t * | data_ptr | ||
) |
Read 2 byte length TLV.
- Parameters:
-
ptr pointer TLV message array. length length of TLV message array. type Type of TLV. data_ptr pointer to variable where the value is read.
- Returns:
- pointer length of TLV 2 if success. 0 means TLV not found or does not have any data.
- Any other value indicates that TLV is not as expected.
uint8_t thread_meshcop_tlv_data_get_uint32 | ( | const uint8_t * | ptr, |
const uint16_t | length, | ||
const uint8_t | type, | ||
uint32_t * | data_ptr | ||
) |
Read 4 byte length TLV.
- Parameters:
-
ptr pointer TLV message array. length length of TLV message array. type Type of TLV. data_ptr pointer to variable where the value is read.
- Returns:
- pointer length of TLV 4 if success. 0 means TLV not found or does not have any data.
- Any other value indicates that TLV is not as expected.
uint8_t thread_meshcop_tlv_data_get_uint64 | ( | const uint8_t * | ptr, |
const uint16_t | length, | ||
const uint8_t | type, | ||
uint64_t * | data_ptr | ||
) |
Read 8 byte length TLV.
- Parameters:
-
ptr pointer TLV message array. length length of TLV message array. type Type of TLV. data_ptr pointer to variable where the value is read.
- Returns:
- pointer length of TLV 4 if success. 0 means TLV not found or does not have any data.
- Any other value indicates that TLV is not as expected.
uint8_t thread_meshcop_tlv_data_get_uint8 | ( | const uint8_t * | ptr, |
const uint16_t | length, | ||
const uint8_t | type, | ||
uint8_t * | data_ptr | ||
) |
Read 1 byte length TLV.
- Parameters:
-
ptr pointer TLV message array. length length of TLV message array. type Type of TLV. data_ptr pointer to variable where the value is read.
- Returns:
- pointer length of TLV 1 if success. 0 means TLV not found or does not have any data.
- Any other value indicates that TLV is not as expected.
uint8_t* thread_meshcop_tlv_data_write | ( | uint8_t * | ptr, |
const uint8_t | type, | ||
const uint16_t | length, | ||
const uint8_t * | data | ||
) |
Write array TLV.
- Parameters:
-
ptr pointer for array where to write the TLV. type Type of TLV. length length of the data that is written in TLV. data array for TLV value.
- Returns:
- pointer value for writing the next TLV.
uint8_t* thread_meshcop_tlv_data_write_header | ( | uint8_t * | ptr, |
uint8_t | type, | ||
uint16_t | length | ||
) |
Write header.
- Parameters:
-
ptr pointer for array where to write the TLV. type Type of TLV. length length of the data that is written in TLV.
- Returns:
- pointer value for writing the remaining bytes of network data.
uint8_t* thread_meshcop_tlv_data_write_uint16 | ( | uint8_t * | ptr, |
const uint8_t | type, | ||
const uint16_t | data | ||
) |
Write 2 byte length TLV.
- Parameters:
-
ptr pointer for array where to write the TLV. type Type of TLV. data value.
- Returns:
- pointer value for writing the next TLV.
uint8_t* thread_meshcop_tlv_data_write_uint32 | ( | uint8_t * | ptr, |
const uint8_t | type, | ||
const uint32_t | data | ||
) |
Write 4 byte length TLV.
- Parameters:
-
ptr pointer for array where to write the TLV. type Type of TLV. data value.
- Returns:
- pointer value for writing the next TLV.
uint8_t* thread_meshcop_tlv_data_write_uint64 | ( | uint8_t * | ptr, |
const uint8_t | type, | ||
const uint64_t | data | ||
) |
Write 8 byte length TLV.
- Parameters:
-
ptr pointer for array where to write the TLV. type Type of TLV. data value.
- Returns:
- pointer value for writing the next TLV.
uint8_t* thread_meshcop_tlv_data_write_uint8 | ( | uint8_t * | ptr, |
const uint8_t | type, | ||
const uint8_t | data | ||
) |
Write 1 byte length TLV.
- Parameters:
-
ptr pointer for array where to write the TLV. type Type of TLV. data value.
- Returns:
- pointer value for writing the next TLV.
bool thread_meshcop_tlv_exist | ( | const uint8_t * | ptr, |
const uint16_t | length, | ||
const uint8_t | type | ||
) |
Check if TLV exists in the message.
- Parameters:
-
ptr Message buffer. length Length of the message buffer to validate message. type Type of TLV searched.
- Returns:
- true if TLV is found.
- false if TLV does not exist.
uint16_t thread_meshcop_tlv_find | ( | const uint8_t * | ptr, |
const uint16_t | length, | ||
const uint8_t | type, | ||
uint8_t ** | result_ptr | ||
) |
Find TLV from message.
- Parameters:
-
ptr Message buffer. length Length of the message buffer to validate message. type Type of TLV searched. result_ptr Pointer value is given as result if length is positive. Can be NULL which only searches for the length.
- Returns:
- The length of the TLV data found
- 0 if TLV is empty or no TLV found.
- negative value indicates corrupted message.
Generated on Tue Jul 12 2022 11:03:06 by
