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: TYBLE16_simple_data_logger TYBLE16_MP3_Air
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. | |
| int16_t | thread_meshcop_tlv_length (const uint8_t *ptr, uint16_t length) |
| Get length of the TLV. | |
| int16_t | thread_meshcop_tlv_length_required (const uint8_t *ptr, uint16_t length) |
| Get length of the TLV including the type and length field. | |
| const uint8_t * | thread_meshcop_tlv_get_next (const uint8_t *ptr, uint16_t *length) |
| Go through TLV list in order. | |
| bool | thread_meshcop_tlv_list_present (const uint8_t *ptr, uint16_t length, const uint8_t *required_tlv_ptr, uint8_t required_tlv_len) |
| Validate that required TLVs are present in the buffer. | |
| uint16_t | thread_meshcop_tlv_list_generate (const uint8_t *ptr, uint16_t length, uint8_t *result_ptr, uint16_t *result_len) |
| Get list of TLVS included in the buffer. | |
| uint16_t | thread_meshcop_tlv_list_remove (uint8_t *tlv_ptr, uint16_t tlv_len, uint8_t tlv_type) |
| Remove TLV from list of TLVs. | |
| bool | thread_meshcop_tlv_list_type_available (const uint8_t *list_ptr, uint16_t list_len, uint8_t tlv_type) |
| Check if specific type is available in list of TLVs. | |
| uint16_t | thread_meshcop_tlv_find_next (uint8_t *tlv_ba, uint16_t tlv_ba_length, uint8_t tlv_id, uint8_t **found_tlv) |
| Find next 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.
Definition at line 526 of file thread_meshcop_lib.c.
| 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.
Definition at line 535 of file thread_meshcop_lib.c.
| 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.
Definition at line 544 of file thread_meshcop_lib.c.
| 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.
Definition at line 517 of file thread_meshcop_lib.c.
| 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.
Definition at line 407 of file thread_meshcop_lib.c.
| 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.
Definition at line 53 of file thread_meshcop_lib.c.
| 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.
Definition at line 424 of file thread_meshcop_lib.c.
| 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.
Definition at line 432 of file thread_meshcop_lib.c.
| 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.
Definition at line 440 of file thread_meshcop_lib.c.
| 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.
Definition at line 416 of file thread_meshcop_lib.c.
| 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.
Definition at line 447 of file thread_meshcop_lib.c.
| 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.
Definition at line 398 of file thread_meshcop_lib.c.
| uint16_t thread_meshcop_tlv_find_next | ( | uint8_t * | tlv_ba, |
| uint16_t | tlv_ba_length, | ||
| uint8_t | tlv_id, | ||
| uint8_t ** | found_tlv | ||
| ) |
Find next TLV from message.
- Parameters:
-
tlv_ba TLV message buffer. tlv_ba_length Length of the TLV message buffer. tlv_id ID of the TLV to be searched. found_tlv [IN] Pointer value is given as result if length is > 0. Can be NULL which only searches for the length. \ [OUT] Pointer to previous TLV found
- Returns:
- The length of the TLV data found and found_tlv updated to point beginning of value field. 0 if TLV is not found.
Definition at line 508 of file thread_meshcop_lib.c.
| const uint8_t * thread_meshcop_tlv_get_next | ( | const uint8_t * | ptr, |
| uint16_t * | length | ||
| ) |
Go through TLV list in order.
- Parameters:
-
ptr Message buffer. length Length of the message buffer to validate message. Length value modified to remaining value or 0 when no more TLVs present
- Returns:
- ptr to the next TLV
- NULL if no TLV found.
Definition at line 469 of file thread_meshcop_lib.c.
| int16_t thread_meshcop_tlv_length | ( | const uint8_t * | ptr, |
| uint16_t | length | ||
| ) |
Get length of the TLV.
- Parameters:
-
ptr Message buffer. length Length of the message buffer to validate message.
- Returns:
- The length of the TLV data found
- 0 if TLV is empty.
- negative value indicates corrupted message or no TLV present.
Definition at line 455 of file thread_meshcop_lib.c.
| int16_t thread_meshcop_tlv_length_required | ( | const uint8_t * | ptr, |
| uint16_t | length | ||
| ) |
Get length of the TLV including the type and length field.
- Parameters:
-
ptr Message buffer. length Length of the message buffer to validate message.
- Returns:
- The length of the TLV data found
- 0 if TLV is empty.
- negative value indicates corrupted message or no TLV present.
Definition at line 462 of file thread_meshcop_lib.c.
| uint16_t thread_meshcop_tlv_list_generate | ( | const uint8_t * | ptr, |
| uint16_t | length, | ||
| uint8_t * | result_ptr, | ||
| uint16_t * | result_len | ||
| ) |
Get list of TLVS included in the buffer.
- Parameters:
-
ptr TLV message buffer. length Length of the TLV message buffer. result_ptr [OUT] buffer where the IDs of TLVs are written. can be NULL when counting amount of TLVs result_len [OUT] Amount of TLVs written in buffer
- Returns:
- amount of TLVs present in the buffer.
Definition at line 484 of file thread_meshcop_lib.c.
| bool thread_meshcop_tlv_list_present | ( | const uint8_t * | ptr, |
| uint16_t | length, | ||
| const uint8_t * | required_tlv_ptr, | ||
| uint8_t | required_tlv_len | ||
| ) |
Validate that required TLVs are present in the buffer.
- Parameters:
-
ptr TLV message buffer. length Length of the TLV message buffer. required_tlv_ptr buffer where the IDs of TLVs that are must be present required_tlv_len Amount of TLVs
- Returns:
- amount of TLVs present in the buffer.
Definition at line 476 of file thread_meshcop_lib.c.
| uint16_t thread_meshcop_tlv_list_remove | ( | uint8_t * | tlv_ptr, |
| uint16_t | tlv_len, | ||
| uint8_t | tlv_type | ||
| ) |
Remove TLV from list of TLVs.
- Parameters:
-
tlv_ptr pointer to TLV List buffer. tlv_len Length of the TLV list buffer. tlv_type TLV that is removed from the List
- Returns:
- amount of TLVs present in the buffer.
Definition at line 492 of file thread_meshcop_lib.c.
| bool thread_meshcop_tlv_list_type_available | ( | const uint8_t * | list_ptr, |
| uint16_t | list_len, | ||
| uint8_t | tlv_type | ||
| ) |
Check if specific type is available in list of TLVs.
- Parameters:
-
list_ptr Pointer to TLV list buffer. list_len Length of the TLV list buffer. tlv_type TLV type to be find from the list
- Returns:
- true if type exists, false if type does not exist.
Definition at line 500 of file thread_meshcop_lib.c.
Generated on Tue Jul 12 2022 13:55:19 by
1.7.2