Rtos API example
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. |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
int thread_test_router_downgrade | ( | int8_t | interface_id ) |
Start router downgrade process.
- Parameters:
-
interface_id Network Interface
- Returns:
- 0, downgrade started
- <0 fail
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
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
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
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
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
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
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
Generated on Sun Jul 17 2022 08:25:35 by 1.7.2