thread_management_if.h File Reference
Thread management interface. More...
Go to the source code of this file.
Data Structures | |
struct | link_configuration |
Thread network configuration. More... | |
Typedefs | |
typedef struct link_configuration | link_configuration_s |
Thread network configuration. | |
Enumerations | |
enum | thread_device_type_e |
Thread device type. More... | |
Functions | |
int | thread_management_node_init (int8_t interface_id, channel_list_s *channel_list, device_configuration_s *device_configuration, link_configuration_s *static_configuration) |
Initialize Thread stack to node mode. | |
int | thread_management_device_type_set (int8_t interface_id, thread_device_type_e device_type) |
Change thread device type. | |
link_configuration_s * | thread_management_configuration_get (int8_t interface_id) |
Get Thread network settings. | |
int | thread_management_link_configuration_store (int8_t interface_id, link_configuration_s *link_config) |
Store Thread network link configuration settings to NVM. | |
int | thread_management_link_configuration_add (int8_t interface_id, uint8_t *additional_ptr, uint8_t additional_len) |
Configure extra TLVs in nanostack . | |
int | thread_management_link_configuration_delete (int8_t interface_id) |
Delete Thread network link configuration settings. | |
device_configuration_s * | thread_management_device_configuration_get (int8_t interface_id) |
Get Thread device settings. | |
int | thread_management_max_child_count (int8_t interface_id, uint8_t maxChildCount) |
Thread router max child count set. | |
int8_t | thread_management_set_link_timeout (int8_t interface_id, uint32_t link_timeout) |
Set Thread device link timeout. | |
int8_t | thread_management_get_link_timeout (int8_t interface_id, uint32_t *link_timeout) |
Get link timeout from Thread device. | |
int8_t | thread_management_set_request_full_nwk_data (int8_t interface_id, bool full_nwk_data) |
Set Thread request full network data. | |
int8_t | thread_management_get_request_full_nwk_data (int8_t interface_id, bool *full_nwk_data) |
Get Thread request full network data. | |
int | thread_management_get_leader_address (int8_t interface_id, uint8_t *address_ptr) |
Additional Thread device settings. | |
int | thread_management_get_leader_aloc (int8_t interface_id, uint8_t *address_ptr) |
Get leader anycast address. | |
int | thread_management_get_parent_address (int8_t interface_id, uint8_t *address_ptr) |
Get parent link local 16 address. | |
int | thread_management_get_ml64_address (int8_t interface_id, uint8_t *address_ptr) |
Get own mesh local 64 address. | |
int | thread_management_get_ml16_address (int8_t interface_id, uint8_t *address_ptr) |
Get own mesh local 16 address. | |
int | thread_management_get_commissioner_address (int8_t interface_id, uint8_t *address_ptr, uint16_t *port_ptr) |
Get commissioner address. | |
int | thread_management_device_certificate_set (int8_t interface_id, const unsigned char *device_certificate_ptr, uint16_t device_certificate_len, const unsigned char *priv_key_ptr, uint16_t priv_key_len) |
Set device certificate. | |
int | thread_management_network_certificate_set (int8_t interface_id, const unsigned char *network_certificate_ptr, uint16_t network_certificate_len, const unsigned char *priv_key_ptr, uint16_t priv_key_len) |
Set network certificate. | |
int | thread_management_partition_weighting_set (int8_t interface_id, uint8_t partition_weighting) |
Set Thread partition weighting. | |
int | thread_management_sed_parent_buffer_size_set (int8_t interface_id, uint16_t small_packets_per_child_count, uint16_t big_packets_total_count) |
Set Thread Sleepy End Device parent packet buffer size. |
Detailed Description
Thread management interface.
This interface is used for configuring Thread devices. After creating the Thread interface, you can use this interface to configure the Thread device behaviour. When you are done with the configurations, you need to call interface up to enable a Thread node.
Definition in file thread_management_if.h.
Typedef Documentation
typedef struct link_configuration link_configuration_s |
Thread network configuration.
You can use this structure in start-up in case of a static configuration. This data can also be read after joining the Thread network. If this data is not provided to the stack, the device starts the commissioning process to join the Thread network.
If the data is provided, all fields must be initialised to 0.
If XPANID and MASTER KEY are provided, the device starts out-of-band commissioning. The values must be initialised to other than 0. If mesh_local_eid is initialised to 0 it is randomized at start-up. If extended_random_mac is initialised to 0 it is randomized at start-up.
If timestamp values are set to 0 it triggers a network configuration update when joining the network.
Enumeration Type Documentation
enum thread_device_type_e |
Thread device type.
REED - Router enabled End device. Device can become router or end device depending on network conditions. FED - Full End Device. Device creates links and makes address queries but does not become router. MED - Minimal End Device. Device communicates through parent. With radio on SED - Sleepy End Device. Device communicates through parent. Uses data poll to sleep.
Definition at line 149 of file thread_management_if.h.
Function Documentation
link_configuration_s* thread_management_configuration_get | ( | int8_t | interface_id ) |
Get Thread network settings.
Configuration is a pointer to the static configuration and only valid in current context.
- Parameters:
-
interface_id Network interface ID.
- Returns:
- Pointer to link configuration.
- NULL Failure.
Definition at line 1024 of file thread_management_if.c.
int thread_management_device_certificate_set | ( | int8_t | interface_id, |
const unsigned char * | device_certificate_ptr, | ||
uint16_t | device_certificate_len, | ||
const unsigned char * | priv_key_ptr, | ||
uint16_t | priv_key_len | ||
) |
Set device certificate.
This function sets device certificate
- Parameters:
-
interface_id Network interface ID. device_certificate_ptr A pointer to the device certificate. device_certificate_len Length of device certificate. priv_key_ptr A private key priv_key_len Length of a private key
- Returns:
- 0, OK.
- <0 fail.
Definition at line 1379 of file thread_management_if.c.
device_configuration_s* thread_management_device_configuration_get | ( | int8_t | interface_id ) |
Get Thread device settings.
Configuration is a pointer to the static device configuration and only valid in current context.
- Parameters:
-
interface_id Network interface ID.
- Returns:
- Pointer to Device configuration.
- NULL Failure.
Definition at line 1034 of file thread_management_if.c.
int thread_management_device_type_set | ( | int8_t | interface_id, |
thread_device_type_e | device_type | ||
) |
Change thread device type.
This function modifies the thread device mode. Default values are given in function arm_nwk_interface_configure_6lowpan_bootstrap_set().
If this function is called when interface is up re-attach is made.
- Parameters:
-
interface_id Network interface ID. device_type Device type of current bootstrap.
- Returns:
- 0, Set OK.
- <0 Set fail.
Definition at line 949 of file thread_management_if.c.
int thread_management_get_commissioner_address | ( | int8_t | interface_id, |
uint8_t * | address_ptr, | ||
uint16_t * | port_ptr | ||
) |
Get commissioner address.
This function returns the commissioner address where you can continue provisioning traffic. If the commissioner is not present this function returns a failure.
- Parameters:
-
interface_id Network interface ID. address_ptr A pointer to the location of address after copying. port_ptr A pointer to the location of port after copying.
- Returns:
- 0, Read OK.
- <0 Read fail.
Definition at line 1244 of file thread_management_if.c.
int thread_management_get_leader_address | ( | int8_t | interface_id, |
uint8_t * | address_ptr | ||
) |
Additional Thread device settings.
Changing these can cause non-compliance with Thread. Diagnostics functions. Get leader mesh local 16 address.
- Parameters:
-
interface_id Network interface ID. address_ptr A pointer to the location of address after copying.
- Returns:
- 0, Read OK.
- <0 Read fail.
Definition at line 1127 of file thread_management_if.c.
int thread_management_get_leader_aloc | ( | int8_t | interface_id, |
uint8_t * | address_ptr | ||
) |
Get leader anycast address.
Address should be used when contacting Leader without need to know the actual routing details. This address will remain valid even after leader changes.
- Parameters:
-
interface_id Network interface ID. address_ptr A pointer to the location of address after copying.
- Returns:
- 0, Read OK.
- <0 Read fail. Not connected to Thread network.
Definition at line 1149 of file thread_management_if.c.
int8_t thread_management_get_link_timeout | ( | int8_t | interface_id, |
uint32_t * | link_timeout | ||
) |
Get link timeout from Thread device.
- Parameters:
-
interface_id Network interface ID. link_timeout [out] A pointer to the location for writing the timeout.
- Returns:
- 0, Get OK
- <0 Get Fail
Definition at line 1299 of file thread_management_if.c.
int thread_management_get_ml16_address | ( | int8_t | interface_id, |
uint8_t * | address_ptr | ||
) |
Get own mesh local 16 address.
- Parameters:
-
interface_id Network interface ID. address_ptr A pointer to the location of address after copying.
- Returns:
- 0, Read OK.
- <0 Read fail.
Definition at line 1196 of file thread_management_if.c.
int thread_management_get_ml64_address | ( | int8_t | interface_id, |
uint8_t * | address_ptr | ||
) |
Get own mesh local 64 address.
- Parameters:
-
interface_id Network interface ID. address_ptr A pointer to the location of address after copying.
- Returns:
- 0, Read OK.
- <0 Read fail.
Definition at line 1170 of file thread_management_if.c.
int thread_management_get_parent_address | ( | int8_t | interface_id, |
uint8_t * | address_ptr | ||
) |
Get parent link local 16 address.
- Parameters:
-
interface_id Network interface ID. address_ptr A pointer to the location of address after copying.
- Returns:
- 0, Read OK.
- <0 Read fail.
Definition at line 1219 of file thread_management_if.c.
int8_t thread_management_get_request_full_nwk_data | ( | int8_t | interface_id, |
bool * | full_nwk_data | ||
) |
Get Thread request full network data.
- Parameters:
-
interface_id Network interface ID. full_nwk_data [out] Request full network data
- Returns:
- 0, Get OK.
- <0 Get Fail.
Definition at line 1352 of file thread_management_if.c.
int thread_management_link_configuration_add | ( | int8_t | interface_id, |
uint8_t * | additional_ptr, | ||
uint8_t | additional_len | ||
) |
Configure extra TLVs in nanostack .
Storing is asynchronous operation and this method makes a request to store link configuration settings. Operation will be completed in the background. Once settings has been stored the Thread network will be restarted with new configuration settings.
/param interface Id of network interface. -1 if interface_id is not available. /param additional_ptr Pointer to the extra TLV that is to be configured in nanostack /param additional_len Length of the additional TLV
/return 0 if store request is successful. /return < 0 if request is failed.
Definition at line 1072 of file thread_management_if.c.
int thread_management_link_configuration_delete | ( | int8_t | interface_id ) |
Delete Thread network link configuration settings.
Deletion is asynchronous operation and this method makes a request to delete link configuration settings. Operation will be completed in the background. Once settings has been deleted the Thread network will be restarted with default settings.
/param interface Id of network interface. -1 can be used if interface_id is not available.
/return 0 if delete request has been delivered successfully to lower layer. /return -1 if delete failed (request not delivered to lower layer) /return -2 if delete request delivered to lower layer but given interface_id was not valid.
Definition at line 1102 of file thread_management_if.c.
int thread_management_link_configuration_store | ( | int8_t | interface_id, |
link_configuration_s * | link_config | ||
) |
Store Thread network link configuration settings to NVM.
Storing is asynchronous operation and this method makes a request to store link configuration settings. Operation will be completed in the background. Once settings has been stored the Thread network will be restarted with new configuration settings.
/param interface Id of network interface. -1 if interface_id is not available. /param link_config Pointer to a structure containing link configuration parameters
/return 0 if store request has been delivered successfully to lower layer. /return -1 if storing failed (request not delivered to lower layer) /return -2 if store request delivered to lower layer but given interface_id was not valid.
Definition at line 1044 of file thread_management_if.c.
int thread_management_max_child_count | ( | int8_t | interface_id, |
uint8_t | maxChildCount | ||
) |
Thread router max child count set.
This function is used to limit the number of children allowed for parent.
- Parameters:
-
interface_id Network interface ID. maxChildCount Min accepted value is 0 and max 32.
- Returns:
- 0, Set OK.
- <0 Set Fail.
Definition at line 988 of file thread_management_if.c.
int thread_management_network_certificate_set | ( | int8_t | interface_id, |
const unsigned char * | network_certificate_ptr, | ||
uint16_t | network_certificate_len, | ||
const unsigned char * | priv_key_ptr, | ||
uint16_t | priv_key_len | ||
) |
Set network certificate.
This function sets network certificate
- Parameters:
-
interface_id Network interface ID. network_certificate_ptr A pointer array to the network certificate chain. network_certificate_len An array of lengths of network certificates in chain. priv_key_ptr A private key priv_key_len Length of a private key
- Returns:
- 0, OK.
- <0 fail.
Definition at line 1401 of file thread_management_if.c.
int thread_management_node_init | ( | int8_t | interface_id, |
channel_list_s * | channel_list, | ||
device_configuration_s * | device_configuration, | ||
link_configuration_s * | static_configuration | ||
) |
Initialize Thread stack to node mode.
If static configuration is given and new one is updated by commissioner it will override current setup. it is safe to always give this as default configuration.
- Parameters:
-
interface_id Network interface ID. channel_list A pointer to channel list. Can be NULL if all channels accepted. device_configuration A pointer to device configuration. static_configuration A pointer to static configuration. Can be NULL.
- Returns:
- 0, Init OK.
- <0 Init fail.
Definition at line 819 of file thread_management_if.c.
int thread_management_partition_weighting_set | ( | int8_t | interface_id, |
uint8_t | partition_weighting | ||
) |
Set Thread partition weighting.
This function sets weighting value for Thread network partition. Interface will be restarted if interface is active and new weighting value is different than previous weighting value.
- Parameters:
-
interface_id Network interface ID. partition_weighting New weighting value for Thread partition
- Returns:
- 0, OK.
- <0 fail.
Definition at line 1427 of file thread_management_if.c.
int thread_management_sed_parent_buffer_size_set | ( | int8_t | interface_id, |
uint16_t | small_packets_per_child_count, | ||
uint16_t | big_packets_total_count | ||
) |
Set Thread Sleepy End Device parent packet buffer size.
This function can be used to adjust count of packets SED parent is storing.
- Parameters:
-
interface_id Network interface ID. small_packets_per_child_count Number of small packets parent is storing for each SED. big_packets_total_count Number of big packets parent can store for all SEDs.
- Returns:
- 0, OK.
- <0 fail.
int8_t thread_management_set_link_timeout | ( | int8_t | interface_id, |
uint32_t | link_timeout | ||
) |
Set Thread device link timeout.
- Parameters:
-
interface_id Network interface ID. link_timeout New timeout value in seconds.
- Returns:
- 0, Set OK.
- <0 Set Fail.
Definition at line 1273 of file thread_management_if.c.
int8_t thread_management_set_request_full_nwk_data | ( | int8_t | interface_id, |
bool | full_nwk_data | ||
) |
Set Thread request full network data.
- Parameters:
-
interface_id Network interface ID. full_nwk_data Whether or not to request full network data.
- Returns:
- 0, Set OK.
- <0 Set Fail.
Definition at line 1327 of file thread_management_if.c.
Generated on Tue Jul 12 2022 12:22:34 by
