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.
net_thread_test.h File Reference
Thread Library Test API. More...
Go to the source code of this file.
Functions | |
int_fast8_t | arm_nwk_6lowpan_thread_test_add_neighbour (int8_t interface_id, uint16_t neighbour_short_addr, uint_fast8_t link_margin_db, uint8_t id_sequence, const uint8_t *id_mask, const uint8_t *route_data) |
Add a static neighbour. | |
int8_t | thread_reed_set_advertisement_interval (int8_t interface_id, uint16_t advertisement_interval, uint16_t jitter_interval) |
API to set reed advertisement interval. | |
int_fast8_t | arm_nwk_6lowpan_thread_test_remove_neighbour (int8_t interface_id, uint16_t neighbour_short_addr) |
Remove a static neighbour. | |
void | arm_nwk_6lowpan_thread_test_print_routing_database (int8_t interface_id) |
Print routing database. | |
int | thread_test_max_accepted_router_id_limit_set (int8_t interface_id, uint8_t maxRouterLimit) |
Thread Leader max router ID limit set. | |
int8_t | thread_routing_set_network_id_timeout (int8_t interface_id, uint16_t network_id_timeout) |
Set Thread network ID timeout. | |
int8_t | thread_routing_get_network_id_timeout (int8_t interface_id, uint16_t *network_id_timeout) |
Get Thread network ID timeout. | |
int | thread_test_print_network_data (int8_t interface_id) |
Print Thread network data. | |
int | thread_test_set_context_id_reuse_timeout (int8_t interface_id, uint32_t timeout) |
Thread Leader Context ID reuse timeout set. | |
int | thread_test_remove_router_by_id (int8_t interface_id, uint8_t routerId) |
Leader of Thread network can kick Router out from Network. | |
int | thread_test_router_downgrade (int8_t interface_id) |
Start router downgrade process. | |
int | thread_test_security_material_set (int8_t interface_id, bool enableSecurity, uint8_t *thrMasterKey, uint32_t thrKeySequenceCounter, uint32_t thrKeyRotation) |
Set Thread Security Material. | |
int | thread_test_version_set (int8_t interface_id, uint8_t version) |
Set Thread version number. | |
int | thread_test_router_selection_jitter_set (int8_t interface_id, uint32_t jitter) |
Set Thread router selection jitter. | |
int | thread_test_min_delay_timer_set (int8_t interface_id, uint32_t delay_timer_value) |
Sets the thread MIN_DELAY_TIMER default value. | |
int | thread_test_increment_key_sequence_counter (int8_t interface_id) |
Increment Thread key sequence counter. | |
int | thread_test_key_sequence_counter_update (int8_t interface_id, uint32_t thrKeySequenceCounter) |
Set new Thread key sequence counter. | |
int | thread_test_key_rotation_update (int8_t interface_id, uint32_t thrKeyRotation) |
Set new Thread key rotation value. | |
int | thread_test_router_select_threshold_values_set (int8_t interface_id, uint8_t upgradeThreshold, uint8_t downgradeThreshold) |
Thread router select threshold values set. | |
int | thread_test_panid_query_send (int8_t interface_id, uint8_t *address_ptr, uint16_t session_id, uint16_t panid, uint8_t channel_page, uint8_t *mask_ptr) |
Send PAN ID query message to destination. | |
int | thread_test_energy_scan_send (int8_t interface_id, uint8_t *address_ptr, uint16_t session_id, uint8_t channel_page, uint8_t *mask_ptr, uint16_t period, uint8_t count, uint16_t duration) |
Send energy scan message to destination. | |
int | thread_test_announce_ntf_send (int8_t interface_id, uint8_t *address_ptr, uint32_t channel, uint16_t panid, uint64_t timestamp) |
Send announcement message. | |
int | thread_test_announce_begin_send (int8_t interface_id, uint8_t *address_ptr, uint16_t session_id, uint8_t channel_page, uint8_t *mask_ptr, uint16_t period, uint8_t count) |
Send energy scan message to destination. | |
int | thread_test_partition_info_get (int8_t interface_id, uint32_t *partition_id, uint8_t *weighting, uint8_t *data_version, uint8_t *stable_data_version, uint8_t *leader_id) |
Get partition info. | |
int | thread_test_partition_info_set (int8_t interface_id, uint32_t partition_id) |
Set next partition ID when we next time partition. | |
int8_t | thread_test_thread_information_get (int8_t interface_id, uint16_t *short_addr, uint8_t *router_count, bool *network_stable) |
Get thread information. | |
int8_t | thread_test_child_count_get (int8_t interface_id) |
Get child count. | |
int8_t | thread_test_child_info_get (int8_t interface_id, uint8_t index, uint16_t *short_addr, bool *sleepy, uint8_t *mac64, uint8_t *margin) |
Get child information. | |
int8_t | thread_test_neighbour_info_get (int8_t interface_id, uint8_t index, uint16_t *short_addr, uint8_t *mac64, uint8_t *margin) |
Get neighbour information. | |
int | thread_test_diagnostic_command_send (int8_t interface_id, uint8_t *address_ptr, const char *uri_ptr, uint8_t request_length, uint8_t *request_ptr, response_cb *resp_cb) |
Send diagnostic command DEPRECATED. | |
int | thread_test_coap_request_send (int8_t interface_id, uint8_t *address_ptr, uint16_t port, uint8_t msg_type, uint8_t msg_code, uint16_t content_format, const char *uri_ptr, uint8_t *request_ptr, uint8_t request_length, coap_response_cb *resp_cb) |
Send diagnostic request. | |
int8_t | thread_test_initial_slaac_iid_set (int8_t interface_id, uint8_t *iid) |
Set initial SLAAC iid. | |
int8_t | thread_test_router_id_request_send (int8_t interface_id, uint8_t status) |
Send router ID request. | |
int8_t | thread_test_joiner_router_joiner_port_set (uint16_t port) |
Set joiner port to joiner router device. | |
int8_t | thread_test_router_address_set (int8_t interface_id, uint16_t router_addr) |
set a router address to be requested. | |
int | thread_test_mle_message_send (int8_t interface_id, uint8_t *dst_address, uint8_t msg_id, bool write_src_addr, bool write_leader_data, bool write_network_data, bool write_timestamp, bool write_operational_set, bool write_challenge, uint8_t *msg_ptr, uint8_t msg_len) |
sends any MLE message to any destination. | |
int | thread_test_extension_name_set (int8_t interface_id, char extension_name[16]) |
Set extension name. |
Detailed Description
Thread Library Test API.
- Warning:
- NOTICE! This is test API must not be used externally.
- This file is not part of the version number control and can change any time.
Definition in file net_thread_test.h.
Function Documentation
int_fast8_t arm_nwk_6lowpan_thread_test_add_neighbour | ( | int8_t | interface_id, |
uint16_t | neighbour_short_addr, | ||
uint_fast8_t | link_margin_db, | ||
uint8_t | id_sequence, | ||
const uint8_t * | id_mask, | ||
const uint8_t * | route_data | ||
) |
Add a static neighbour.
Test API: Add a neighbour. Adds, or updates, a non-expiring neighbour to the Thread Link Set, and updates the Route Set accordingly. Basically equivalent to receiving an MLE advertisement with a Route TLV, except it doesn't expire.
See draft-kelsey-thread-routing-00 for more info on data format.
- Parameters:
-
interface_id Interface to modify neighbour_addr Neighbour short address (must be a router address) link_margin_db Notional link margin for reception from this neighbour. id_sequence Sequence number for id_mask id_mask Bit mask of router IDs route_data One octet per set bit in id_mask
- Returns:
- 0 Success
- <0 Failure
Definition at line 61 of file thread_test_api.c.
void arm_nwk_6lowpan_thread_test_print_routing_database | ( | int8_t | interface_id ) |
Print routing database.
Test API: Dump the routing data base (Router ID Set, Link Set and Route Set) to the debug channel.
- Parameters:
-
interface_id Interface to interrogate
Definition at line 110 of file thread_test_api.c.
int_fast8_t arm_nwk_6lowpan_thread_test_remove_neighbour | ( | int8_t | interface_id, |
uint16_t | neighbour_short_addr | ||
) |
Remove a static neighbour.
Test API: Remove a neighbour. Remove a neighbour from the Thread Link Set (whether added through arm_nwk_6lowpan_thread_test_add_neighbour, or automatically through MLE).
- Parameters:
-
interface_id Interface to modify neighbour_addr Neighbour short address (must be a router address)
- Returns:
- 0 Success
- -1 Not an existing neighbour
- <-1 Other errors
Definition at line 89 of file thread_test_api.c.
int8_t thread_reed_set_advertisement_interval | ( | int8_t | interface_id, |
uint16_t | advertisement_interval, | ||
uint16_t | jitter_interval | ||
) |
API to set reed advertisement interval.
- Parameters:
-
interface_id Interface to modify advertisement_interval Interval between advertisements to be set jitter_interval Maximum value of random jitter interval to be added to advertisement_interval
- Returns:
- 0 Success
- < 0 Other errors
Definition at line 353 of file thread_test_api.c.
int8_t thread_routing_get_network_id_timeout | ( | int8_t | interface_id, |
uint16_t * | network_id_timeout | ||
) |
Get Thread network ID timeout.
- Parameters:
-
interface_id Interface to modify network_id_timeout pointer, where current network id timeout will be saved as seconds
- Returns:
- 0 Success
- -1 Invalid interface id
- -2 Thread not active
- -3 invalid pointer
Definition at line 198 of file thread_test_api.c.
int8_t thread_routing_set_network_id_timeout | ( | int8_t | interface_id, |
uint16_t | network_id_timeout | ||
) |
Set Thread network ID timeout.
- Parameters:
-
interface_id Interface to modify network_id_timeout network timeout as seconds
- Returns:
- 0 Success
- -1 Invalid interface id
- -2 Thread not active
- -3 invalid timeout value
Definition at line 170 of file thread_test_api.c.
int thread_test_announce_begin_send | ( | int8_t | interface_id, |
uint8_t * | address_ptr, | ||
uint16_t | session_id, | ||
uint8_t | channel_page, | ||
uint8_t * | mask_ptr, | ||
uint16_t | period, | ||
uint8_t | count | ||
) |
Send energy scan message to destination.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 947 of file thread_test_api.c.
int thread_test_announce_ntf_send | ( | int8_t | interface_id, |
uint8_t * | address_ptr, | ||
uint32_t | channel, | ||
uint16_t | panid, | ||
uint64_t | timestamp | ||
) |
Send announcement message.
- Parameters:
-
interface_id Network Interface channel high uint16 is the channel page, lower part is the channel number on that page
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 926 of file thread_test_api.c.
int8_t thread_test_child_count_get | ( | int8_t | interface_id ) |
Get child count.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 1074 of file thread_test_api.c.
int8_t thread_test_child_info_get | ( | int8_t | interface_id, |
uint8_t | index, | ||
uint16_t * | short_addr, | ||
bool * | sleepy, | ||
uint8_t * | mac64, | ||
uint8_t * | margin | ||
) |
Get child information.
get information for index child. if found returns 0 with correct information.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, OK
- <0 Fail no child with this index found
Definition at line 1089 of file thread_test_api.c.
int thread_test_coap_request_send | ( | int8_t | interface_id, |
uint8_t * | address_ptr, | ||
uint16_t | port, | ||
uint8_t | msg_type, | ||
uint8_t | msg_code, | ||
uint16_t | content_format, | ||
const char * | uri_ptr, | ||
uint8_t * | request_ptr, | ||
uint8_t | request_length, | ||
coap_response_cb * | resp_cb | ||
) |
Send diagnostic request.
- Parameters:
-
interface_id Network Interface address_ptr Address to which the command is sent msg_type Uri for the command msg_code Uri for the command uri_ptr Uri for the command request_length The length of the request request_ptr Pointer to the beginning of the request contents resp_cb Pointer to callback function that is called after the reply for the command is obtained
- Returns:
- 0, Command send OK
- <0 Command send Fail
Definition at line 899 of file thread_test_api.c.
int thread_test_diagnostic_command_send | ( | int8_t | interface_id, |
uint8_t * | address_ptr, | ||
const char * | uri_ptr, | ||
uint8_t | request_length, | ||
uint8_t * | request_ptr, | ||
response_cb * | resp_cb | ||
) |
Send diagnostic command DEPRECATED.
- Parameters:
-
interface_id Network Interface address_ptr Address to which the command is sent uri_ptr Uri for the command request_length The length of the request request_ptr Pointer to the beginning of the request contents resp_cb Pointer to callback function that is called after the reply for the command is obtained
- Returns:
- 0, Command send OK
- <0 Command send Fail
Definition at line 856 of file thread_test_api.c.
int thread_test_energy_scan_send | ( | int8_t | interface_id, |
uint8_t * | address_ptr, | ||
uint16_t | session_id, | ||
uint8_t | channel_page, | ||
uint8_t * | mask_ptr, | ||
uint16_t | period, | ||
uint8_t | count, | ||
uint16_t | duration | ||
) |
Send energy scan message to destination.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 820 of file thread_test_api.c.
int thread_test_extension_name_set | ( | int8_t | interface_id, |
char | extension_name[16] | ||
) |
Set extension name.
- Parameters:
-
interface_id Network Interface extension_name Extension name string
- Returns:
- 0 OK
- <0 Failure
Definition at line 1327 of file thread_test_api.c.
int thread_test_increment_key_sequence_counter | ( | int8_t | interface_id ) |
Increment Thread key sequence counter.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, OK
- <0 Error
Definition at line 654 of file thread_test_api.c.
int8_t thread_test_initial_slaac_iid_set | ( | int8_t | interface_id, |
uint8_t * | iid | ||
) |
Set initial SLAAC iid.
- Parameters:
-
interface_id Network Interface iid Interface identifier pointer must be 8 bytes long buffer. can be NULL to disable.
- Returns:
- 0, Command OK
- <0 Command Fail
Definition at line 1164 of file thread_test_api.c.
int8_t thread_test_joiner_router_joiner_port_set | ( | uint16_t | port ) |
Set joiner port to joiner router device.
If port == 0, then default port is used.
- Parameters:
-
iid Joiner port.
- Returns:
- 0, Command OK
- <0 Command Fail
Definition at line 1229 of file thread_test_api.c.
int thread_test_key_rotation_update | ( | int8_t | interface_id, |
uint32_t | thrKeyRotation | ||
) |
Set new Thread key rotation value.
- Parameters:
-
interface_id Network interface ID thrKeyRotation Key rotation value in seconds
- Returns:
- 0, OK
- <0 Error
Definition at line 416 of file thread_test_api.c.
int thread_test_key_sequence_counter_update | ( | int8_t | interface_id, |
uint32_t | thrKeySequenceCounter | ||
) |
Set new Thread key sequence counter.
Call define new key and next key same time
- Parameters:
-
interface_id Network Interface thrKeySequenceCounter this need to be bigger than current sequence
- Returns:
- 0, OK
- <0 Error
Definition at line 386 of file thread_test_api.c.
int thread_test_max_accepted_router_id_limit_set | ( | int8_t | interface_id, |
uint8_t | maxRouterLimit | ||
) |
Thread Leader max router ID limit set.
This function should use just for test purpose Thread define this by default to 32
- Parameters:
-
interface_id Network Interface maxRouterLimit Min Accepted value is 1 and max 32
return 0, Set OK return <0 Set Fail
Definition at line 485 of file thread_test_api.c.
int thread_test_min_delay_timer_set | ( | int8_t | interface_id, |
uint32_t | delay_timer_value | ||
) |
Sets the thread MIN_DELAY_TIMER default value.
- Parameters:
-
interface_id Network Interface delay_timer_value delay timer value in seconds used in leader
- Returns:
- 0, OK
- <0 Error
Definition at line 637 of file thread_test_api.c.
int thread_test_mle_message_send | ( | int8_t | interface_id, |
uint8_t * | dst_address, | ||
uint8_t | msg_id, | ||
bool | write_src_addr, | ||
bool | write_leader_data, | ||
bool | write_network_data, | ||
bool | write_timestamp, | ||
bool | write_operational_set, | ||
bool | write_challenge, | ||
uint8_t * | msg_ptr, | ||
uint8_t | msg_len | ||
) |
sends any MLE message to any destination.
- Parameters:
-
interface_id Network Interface dst_address destination address msg_id MLE message id write_src_addr write short address of the device write_leader_data write leader data write_network_data write network data write_timestamp write current timestamps* write_operational_set write current operational datasets * write_challenge add challenge to the message msg_ptr additional buffer addded to message msg_len length of the additional message
- Returns:
- 0, Command OK
- <0 Command Fail
Definition at line 1246 of file thread_test_api.c.
int8_t thread_test_neighbour_info_get | ( | int8_t | interface_id, |
uint8_t | index, | ||
uint16_t * | short_addr, | ||
uint8_t * | mac64, | ||
uint8_t * | margin | ||
) |
Get neighbour information.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 1127 of file thread_test_api.c.
int thread_test_panid_query_send | ( | int8_t | interface_id, |
uint8_t * | address_ptr, | ||
uint16_t | session_id, | ||
uint16_t | panid, | ||
uint8_t | channel_page, | ||
uint8_t * | mask_ptr | ||
) |
Send PAN ID query message to destination.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 790 of file thread_test_api.c.
int thread_test_partition_info_get | ( | int8_t | interface_id, |
uint32_t * | partition_id, | ||
uint8_t * | weighting, | ||
uint8_t * | data_version, | ||
uint8_t * | stable_data_version, | ||
uint8_t * | leader_id | ||
) |
Get partition info.
- Parameters:
-
interface_id Network Interface partition_id Current partition id can be NULL if not needed. weighting Current weighting can be NULL if not needed. data_version Current data version can be NULL if not needed. stable_data_version Current stable data version can be NULL if not needed. leader_id Current leader id can be NULL if not needed.
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 982 of file thread_test_api.c.
int thread_test_partition_info_set | ( | int8_t | interface_id, |
uint32_t | partition_id | ||
) |
Set next partition ID when we next time partition.
This is used to control specific behaviour in tests.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 1021 of file thread_test_api.c.
int thread_test_print_network_data | ( | int8_t | interface_id ) |
Print Thread network data.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, OK
- <0 Not OK
Definition at line 325 of file thread_test_api.c.
int thread_test_remove_router_by_id | ( | int8_t | interface_id, |
uint8_t | routerId | ||
) |
Leader of Thread network can kick Router out from Network.
- Parameters:
-
interface_id Network Interface routerId Routter id of router that is kicked
- Returns:
- 0, Remove OK
- <0 Remove fail
Definition at line 256 of file thread_test_api.c.
int8_t thread_test_router_address_set | ( | int8_t | interface_id, |
uint16_t | router_addr | ||
) |
set a router address to be requested.
For a router, this address is sent address solicit request to leader and for leader this is the router address
- Parameters:
-
interface_id Network Interface router_addr Address requested
- Returns:
- 0, Command OK
- <0 Command Fail
Definition at line 1204 of file thread_test_api.c.
int thread_test_router_downgrade | ( | int8_t | interface_id ) |
Start router downgrade process.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, downgrade started
- <0 fail
Definition at line 297 of file thread_test_api.c.
int8_t thread_test_router_id_request_send | ( | int8_t | interface_id, |
uint8_t | status | ||
) |
Send router ID request.
- Parameters:
-
interface_id Network Interface status Value of router ID request status TLV
- Returns:
- 0, Command OK
- <0 Command Fail
Definition at line 1177 of file thread_test_api.c.
int thread_test_router_select_threshold_values_set | ( | int8_t | interface_id, |
uint8_t | upgradeThreshold, | ||
uint8_t | downgradeThreshold | ||
) |
Thread router select threshold values set.
- Parameters:
-
interface_id Network Interface upgradeThreshold Set REED up grade to router threshold downgradeThreshold Set Router down grade to REED threshold
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 446 of file thread_test_api.c.
int thread_test_router_selection_jitter_set | ( | int8_t | interface_id, |
uint32_t | jitter | ||
) |
Set Thread router selection jitter.
- Parameters:
-
interface_id Network Interface value must be over 1 default is 120
- Returns:
- 0, OK
- <0 Error
Definition at line 616 of file thread_test_api.c.
int thread_test_security_material_set | ( | int8_t | interface_id, |
bool | enableSecurity, | ||
uint8_t * | thrMasterKey, | ||
uint32_t | thrKeySequenceCounter, | ||
uint32_t | thrKeyRotation | ||
) |
Set Thread Security Material.
Terms are defined in Thread security specification
- Parameters:
-
interface_id Network Interface enableSecurity Boolean for enable security or disable thrMasterKey Master Key material which will be used for generating new key thrKeySequenceCounter Periodic counter used to generate new MAC and MLE keys thrKeyRotation Update period (in seconds) for thrKeySequenceCounter
- Returns:
- 0, ADD OK
- <0 Add Not OK
Set Thread Security Material.
- Parameters:
-
interface_id Network Interface enableSecurity Boolean for enable security or disable threadMasterKey Thread Master Key material which will be used for generating new key threadMasterKeyIndex Thread key material key index which will be increment periodically keyRollPeriod Define Key index & key update process
return 0, ADD OK return <0 Add Not OK
Definition at line 529 of file thread_test_api.c.
int thread_test_set_context_id_reuse_timeout | ( | int8_t | interface_id, |
uint32_t | timeout | ||
) |
Thread Leader Context ID reuse timeout set.
This function should be used to change default 48 hours to shorter one
- Parameters:
-
interface_id Network Interface timeout Min Accepted value is 60 seconds and max 48 hours (48*3600)
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 225 of file thread_test_api.c.
int8_t thread_test_thread_information_get | ( | int8_t | interface_id, |
uint16_t * | short_addr, | ||
uint8_t * | router_count, | ||
bool * | network_stable | ||
) |
Get thread information.
- Parameters:
-
interface_id Network Interface short_addr own short address router_count amount of active routers in network network_stable stable network achieved no upgrade or downgrade pending
- Returns:
- 0, Set OK
- <0 Set Fail
Definition at line 1038 of file thread_test_api.c.
int thread_test_version_set | ( | int8_t | interface_id, |
uint8_t | version | ||
) |
Set Thread version number.
- Parameters:
-
interface_id Network Interface version "1 == Thread version 1.0" or "2 == Thread version 1.1"
- Returns:
- 0, OK
- <0 Error
Definition at line 599 of file thread_test_api.c.
Generated on Tue Jul 12 2022 12:22:32 by
