 |
Wirepas SDK
|
|
Go to the documentation of this file.
15 #ifndef APP_LIB_STATE_H_
16 #define APP_LIB_STATE_H_
27 #define APP_LIB_STATE_NAME 0x02f9c165
30 #define APP_LIB_STATE_VERSION 0x20A
37 #define APP_LIB_STATE_INVALID_ROUTE_COST UINT8_MAX
44 #define APP_LIB_STATE_COST_UNKNOWN 0
51 #define APP_LIB_STATE_LINKREL_UNKNOWN 0
58 #define APP_LIB_STATE_DEFAULT_SCAN 0
app_lib_state_set_energy_f setEnergy
void(* app_lib_state_on_scan_nbors_cb_f)(void)
Function type for a neighbor scan completion callback.
app_res_e(* app_lib_state_get_access_cycle_f)(uint16_t *ac_value_p)
Get current access cycle.
@ APP_LIB_STATE_NEIGHBOR_IS_CLUSTER
@ APP_LIB_STATE_NETWORK_ADDRESS_NOT_SET
Network address is not set.
app_res_e(* app_lib_state_set_on_scan_nbors_with_type_cb_f)(app_lib_state_on_scan_nbors_cb_f cb, app_lib_state_scan_nbors_type_e type)
Set a callback to be called when neighbor scan is complete.
app_lib_state_set_adjust_hops_cb_f setHopsLeftCb
app_lib_state_set_route_cb_f setRouteCb
uint8_t(* app_lib_state_get_route_count_f)(size_t *count_p)
Get the number of routes this node has to a sink.
int8_t txpower
Tx power in dB This equals maximum transmission power that sender can transmit (which is used when tr...
app_lib_state_set_scan_dur_f setScanDuration
uint8_t hops_left
Amount of hops left in this data packet.
app_res_e(* app_lib_state_get_nbors_f)(app_lib_state_nbor_list_t *nbors_list)
Get list of neighbors.
@ APP_LIB_STATE_SCAN_NBORS_ALL
app_res_e(* app_lib_state_start_stack_f)(void)
Start the stack.
Structure to hold the information about received beacons.
@ APP_LIB_STATE_DIRADV_NOT_SUPPORTED
void(* app_lib_state_on_beacon_cb_f)(const app_lib_state_beacon_rx_t *beacon)
Function type for a beacon reception callback.
app_res_e(* app_lib_state_set_sink_cost_f)(const uint8_t cost)
Set additional penalty for the sink usage.
app_lib_state_route_state_e
Route state.
@ APP_LIB_STATE_DIRADV_UNKNOWN
void(* app_lib_state_route_changed_cb_f)(void)
Callback when route is changed.
app_res_e(* app_lib_state_get_install_quality_f)(app_lib_state_install_quality_t *qual_out)
Read installation quality, app_lib_state_install_quality_t.
@ APP_LIB_STATE_NODE_ADDRESS_NOT_SET
Node address is not set.
app_lib_state_get_route_count_f getRouteCount
@ APP_LIB_STATE_ACCESS_DENIED
Operation is not allowed.
install_quality_error_code_e
Error codes for installation quality, if an error code is active, corrective action regarding the ins...
app_lib_state_nbor_info_t * nbors
app_lib_state_start_scan_nbors_f startScanNbors
app_lib_state_scan_stop_f stopScanNbors
Structure for adjusting hops.
Structure for route information.
@ APP_LIB_STATE_BEACON_TYPE_NB
Network beacon.
app_lib_state_set_on_beacon_cb_f setOnBeaconCb
@ APP_LIB_STATE_INSTALL_QUALITY_ERROR_NOROUTE
@ APP_LIB_STATE_ROUTE_STATE_INVALID
No next hop / route.
@ APP_LIB_STATE_DIRADV_SUPPORTED
app_addr_t address
Address of the beacon sender.
@ APP_LIB_STATE_ROLE_NOT_SET
Node role is not set.
@ APP_LIB_STATE_SCAN_NBORS_ONLY_REQUESTED
app_res_e(* app_lib_state_get_route_f)(app_lib_state_route_info_t *info)
Get route information.
@ APP_LIB_STATE_STOPPED
Stack is stopped.
app_res_e(* app_lib_state_get_sink_cost_f)(uint8_t *cost_p)
Query the currently set additional penalty for the sink usage.
app_lib_state_get_nbors_f getNbors
app_res_e(* app_lib_state_set_adjust_hops_cb_f)(app_lib_state_adjust_hops_cb_f cb)
Set a callback to be called when rerouting packet and querying if 'hops left' should be modified (i....
app_lib_state_get_access_cycle_f getAccessCycle
Neighbors list definition.
app_lib_state_get_energy_f getEnergy
@ APP_LIB_STATE_APP_CONFIG_DATA_NOT_SET
app_lib_settings_net_channel_t channel
app_lib_state_set_sink_cost_f setSinkCost
app_lib_state_stop_stack_f stopStack
app_res_e(* app_lib_state_set_energy_f)(uint8_t energy)
Set available energy.
app_res_e(* app_lib_state_stop_stack_f)(void)
Stop the stack.
@ APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONE
app_res_e(* app_lib_state_set_scan_dur_f)(uint32_t duration_us)
Set scan duration to be used.
@ APP_LIB_STATE_ROUTE_STATE_VALID
Valid next hop / route.
app_lib_state_scan_nbors_type_e
Scan neighbor type to specify the scans that trigger the callback.
uint16_t(* app_lib_state_get_diag_interval_f)(void)
Get diagnostics interval.
app_res_e(* app_lib_state_scan_stop_f)(void)
Stops ongoing scan operation before ended.
List of library functions of v3 version (0x202)
app_lib_state_start_stack_f startStack
app_lib_state_get_sink_cost_f getSinkCost
bool is_sink
Device is sink.
app_lib_state_stack_state_e
Stack state flags.
Installation quality information. Contains information about the nodes installation location i....
@ APP_LIB_STATE_INSTALL_QUALITY_ERROR_BADRSSI
app_res_e(* app_lib_state_set_route_cb_f)(const app_lib_state_route_changed_cb_f cb, uint32_t unused)
Set callback for route change notification.
app_res_e(* app_lib_state_set_on_beacon_cb_f)(app_lib_state_on_beacon_cb_f cb)
Set a callback to be called when a beacon is received.
app_lib_state_get_diag_interval_f getDiagInterval
@ APP_LIB_STATE_ROUTE_STATE_PENDING
Acquiring next hop / route.
uint8_t(* app_lib_state_get_stack_state_f)(void)
Get the stack state.
Neighbors info definition.
app_res_e(* app_lib_state_get_energy_f)(uint8_t *energy_p)
Get available energy.
app_lib_state_get_route_f getRouteInfo
bool is_da_support
Sender supports Directed Advertiser sending packets to it.
@ APP_LIB_STATE_NEIGHBOR_IS_NEXT_HOP
app_lib_state_nbor_type_e
Neighbor type.
app_lib_state_get_install_quality_f getInstallQual
app_lib_state_diradv_support_e
Support type for directed advertiser, i.e. does neighbor support sending directed advertiser packets ...
@ APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONBORS
@ APP_LIB_STATE_NEIGHBOR_IS_MEMBER
app_lib_state_set_on_scan_nbors_with_type_cb_f setOnScanNborsCb
app_lib_state_beacon_type_e
Type for beacons, passed in app_lib_state_beacon_rx_t.
@ APP_LIB_STATE_STARTED
Stack is started.
uint8_t(* app_lib_state_adjust_hops_cb_f)(const app_lib_state_hops_adjust_t *info)
Function type for a adjusting hops left.
@ APP_LIB_STATE_NETWORK_CHANNEL_NOT_SET
Network channel is not set.
app_res_e(* app_lib_state_start_scan_nbors_f)(void)
Start neighbor scan.
uint8_t app_lib_settings_net_channel_t
Network channel type definition.
app_lib_state_route_state_e state
app_lib_state_get_stack_state_f getStackState
@ APP_LIB_STATE_BEACON_TYPE_CB
Cluster beacon.