Wirepas SDK
wms_state.h File Reference

Detailed Description

Application library for viewing and controlling stack runtime state

Library services are accessed via lib_state handle.

Definition in file wms_state.h.

Go to the source code of this file.

Typedefs

typedef void(* app_lib_state_on_beacon_cb_f) (const app_lib_state_beacon_rx_t *beacon)
 Function type for a beacon reception callback. More...
 
typedef app_res_e(* app_lib_state_start_stack_f) (void)
 Start the stack. More...
 
typedef app_res_e(* app_lib_state_stop_stack_f) (void)
 Stop the stack. More...
 
typedef uint8_t(* app_lib_state_get_stack_state_f) (void)
 Get the stack state. More...
 
typedef app_res_e(* app_lib_state_get_access_cycle_f) (uint16_t *ac_value_p)
 Get current access cycle. More...
 
typedef void(* app_lib_state_on_stack_event_cb_f) (app_lib_stack_event_e event, void *param)
 Function type stack events callback. More...
 
typedef app_res_e(* app_lib_state_set_stack_event_cb_f) (app_lib_state_on_stack_event_cb_f cb)
 Register callback for stack events. More...
 
typedef app_res_e(* app_lib_state_start_scan_nbors_f) (void)
 Start neighbor scan. More...
 
typedef app_res_e(* app_lib_state_get_nbors_f) (app_lib_state_nbor_list_t *nbors_list)
 Get list of neighbors. More...
 
typedef 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. More...
 
typedef app_res_e(* app_lib_state_get_sink_cost_f) (uint8_t *cost_p)
 Query the currently set additional penalty for the sink usage. More...
 
typedef app_res_e(* app_lib_state_set_sink_cost_f) (const uint8_t cost)
 Set additional penalty for the sink usage. More...
 
typedef app_res_e(* app_lib_state_get_route_f) (app_lib_state_route_info_t *info)
 Get route information. More...
 
typedef app_res_e(* app_lib_state_scan_stop_f) (void)
 Stops ongoing scan operation before ended. More...
 
typedef 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. More...
 

Data Structures

struct  app_lib_state_nbor_info_t
 Neighbors info definition. More...
 
struct  app_lib_state_nbor_list_t
 Neighbors list definition. More...
 
struct  app_lib_state_beacon_rx_t
 Structure to hold the information about received beacons. More...
 
struct  app_lib_state_hops_adjust_t
 
struct  app_lib_state_route_info_t
 Structure for route information. More...
 
struct  app_lib_state_install_quality_t
 Installation quality information. Contains information about the nodes installation location i.e. its quality indicated by a numeric value, as well as error codes if something is wrong with the location. More...
 
struct  app_lib_state_on_scan_start_info_t
 Information on started scan. More...
 
struct  app_lib_state_neighbor_scan_info_t
 Information on neighbor scan. More...
 
struct  app_lib_state_t
 List of library functions. More...
 

Enumerations

enum  app_lib_state_nbor_type_e { APP_LIB_STATE_NEIGHBOR_IS_NEXT_HOP = 0, APP_LIB_STATE_NEIGHBOR_IS_MEMBER = 1, APP_LIB_STATE_NEIGHBOR_IS_CLUSTER = 2 }
 Neighbor type. More...
 
enum  app_lib_state_diradv_support_e { APP_LIB_STATE_DIRADV_SUPPORTED = 0, APP_LIB_STATE_DIRADV_NOT_SUPPORTED = 1, APP_LIB_STATE_DIRADV_UNKNOWN = 2 }
 Support type for directed advertiser, i.e. does neighbor support sending directed advertiser packets to it. More...
 
enum  app_lib_state_scan_nbors_type_e { APP_LIB_STATE_SCAN_NBORS_ALL = 0, APP_LIB_STATE_SCAN_NBORS_ONLY_REQUESTED = 1 }
 Scan neighbor type to specify the scans that trigger the callback. More...
 
enum  app_lib_state_stack_state_e {
  APP_LIB_STATE_STARTED = 0, APP_LIB_STATE_STOPPED = 1, APP_LIB_STATE_NODE_ADDRESS_NOT_SET = 2, APP_LIB_STATE_NETWORK_ADDRESS_NOT_SET = 4,
  APP_LIB_STATE_NETWORK_CHANNEL_NOT_SET = 8, APP_LIB_STATE_ROLE_NOT_SET = 16, APP_LIB_STATE_APP_CONFIG_DATA_NOT_SET = 32, APP_LIB_STATE_ACCESS_DENIED = 128
}
 Stack state flags. More...
 
enum  app_lib_state_route_state_e { APP_LIB_STATE_ROUTE_STATE_INVALID = 0, APP_LIB_STATE_ROUTE_STATE_PENDING = 1, APP_LIB_STATE_ROUTE_STATE_VALID = 2 }
 Route state. More...
 
enum  app_lib_state_beacon_type_e { APP_LIB_STATE_BEACON_TYPE_NB = 0, APP_LIB_STATE_BEACON_TYPE_CB = 1 }
 Type for beacons, passed in app_lib_state_beacon_rx_t. More...
 
enum  install_quality_error_code_e { APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONE = 0x00, APP_LIB_STATE_INSTALL_QUALITY_ERROR_NOROUTE = 0x01, APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONBORS = 0x02, APP_LIB_STATE_INSTALL_QUALITY_ERROR_BADRSSI = 0x04 }
 Error codes for installation quality, if an error code is active, corrective action regarding the installation location is required. More...
 
enum  app_lib_state_scan_type_e { SCAN_TYPE_APP_ORIGINATED = 0x00, SCAN_TYPE_STACK_ORIGINATED = 0x01 }
 Types of scans. More...
 
enum  app_lib_stack_event_e {
  APP_LIB_STATE_STACK_EVENT_STACK_STOPPED = 0, APP_LIB_STATE_STACK_EVENT_STACK_STARTED = 1, APP_LIB_STATE_STACK_EVENT_SCAN_STARTED = 2, APP_LIB_STATE_STACK_EVENT_SCAN_STOPPED = 3,
  APP_LIB_STATE_STACK_EVENT_SCRAT_XFER_STARTED = 4, APP_LIB_STATE_STACK_EVENT_SCRAT_XFER_STOPPED = 5, APP_LIB_STATE_STACK_EVENT_ROUTE_CHANGED = 6
}
 List of event generated by the stack when registering to app_lib_state_set_stack_event_cb_f. More...
 

Macros

#define APP_LIB_STATE_NAME   0x02f9c165
 Library symbolic name. More...
 
#define APP_LIB_STATE_VERSION   0x20D
 Maximum supported library version. More...
 
#define APP_LIB_STATE_INVALID_ROUTE_COST   UINT8_MAX
 Macro for cost indicating "no route". Used in cost component in lib_state->getNbors() service. More...
 
#define APP_LIB_STATE_COST_UNKNOWN   0
 Macro for cost being unknown. Used in cost component in lib_state->getNbors() service. More...
 
#define APP_LIB_STATE_LINKREL_UNKNOWN   0
 Macro for link reliability being unknown. Used in link reliability component in lib_state->getNbors() service. More...
 

Typedef Documentation

◆ app_lib_state_get_access_cycle_f

typedef app_res_e(* app_lib_state_get_access_cycle_f) (uint16_t *ac_value_p)

Get current access cycle.

Parameters
ac_value_pPointer to store the current access cycle value in milliseconds Updated if return code is APP_RES_OK
Returns
Result code, APP_RES_OK if successful, APP_RES_INVALID_STACK_STATE if stack not running

Definition at line 403 of file wms_state.h.

◆ app_lib_state_get_install_quality_f

typedef 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.

Parameters
qual_out[out] The installation quality information is copied to this pointer
Returns
APP_RES_OK if value was read OK

Definition at line 606 of file wms_state.h.

◆ app_lib_state_get_nbors_f

typedef app_res_e(* app_lib_state_get_nbors_f) (app_lib_state_nbor_list_t *nbors_list)

Get list of neighbors.

Parameters
nbors_listPointer to store the information of list of neighbors.
Returns
Result code, always APP_RES_OK

This service can be used to tell the status of a node's neighbors. This information may be used for various purposes, for example to estimate where a node is located.

Example:

#define NBOR_LIST_SIZE 6
app_lib_state_nbor_info_t nbors[NBOR_LIST_SIZE];
{
.number_nbors = NBOR_LIST_SIZE,
.nbors = &nbors[0]
};
...
lib_state->getNbors(&nbors_list);

Definition at line 527 of file wms_state.h.

◆ app_lib_state_get_route_f

typedef app_res_e(* app_lib_state_get_route_f) (app_lib_state_route_info_t *info)

Get route information.

Parameters
info[out] Route information is provided here
Returns
Result code, APP_RES_OK if successful

Definition at line 584 of file wms_state.h.

◆ app_lib_state_get_sink_cost_f

typedef app_res_e(* app_lib_state_get_sink_cost_f) (uint8_t *cost_p)

Query the currently set additional penalty for the sink usage.

Parameters
cost_pPointer to store the current initial cost
Returns
Result code, APP_RES_OK if successful, APP_RES_INVALID_CONFIGURATION if node is not a sink, APP_RES_INVALID_NULL_POINTER if cost_p is NULL

Example:

uint8_t current_cost;
lib_state->getSinkCost(&current_cost);

Definition at line 552 of file wms_state.h.

◆ app_lib_state_get_stack_state_f

typedef uint8_t(* app_lib_state_get_stack_state_f) (void)

Get the stack state.

Returns
Bit field of stack state, app_lib_state_stack_state_e

Service indicates whether the stack is running or not, and whether it can be started.

Example:

state = lib_state->getStackState();

Definition at line 393 of file wms_state.h.

◆ app_lib_state_on_beacon_cb_f

typedef void(* app_lib_state_on_beacon_cb_f) (const app_lib_state_beacon_rx_t *beacon)

Function type for a beacon reception callback.

Parameters
beaconInformation about received beacon

Definition at line 330 of file wms_state.h.

◆ app_lib_state_on_stack_event_cb_f

typedef void(* app_lib_state_on_stack_event_cb_f) (app_lib_stack_event_e event, void *param)

Function type stack events callback.

Parameters
eventWhich event generated this call
param_pParameter pointer associated to the event. This pointer must be casted depending on the event. Its type is listed in app_lib_stack_event_e
Note
Most of the time this callback is generated in critical section of the stack code so execution time must be short
List of event may evolve in future. To write forward compatible code callback must discard unknown event

Example:

static void on_stack_event_cb(app_lib_stack_event_e event, void *param)
{
switch(event)
{
// Do something when stack is stopped
...
break;
// Do something when scan is stopped
scan_info = (app_lib_state_neighbor_scan_info_t *) param;
LOG(LVL_INFO, "Scan stopped: complete=> %d, type=>%d", scan_info->complete, scan_info->scan_type);
...
break;
default:
// Nothing to do. New event may be generated in later release
(void) event;
}
}
...
lib_state->setOnStackEventCb(on_stack_event_cb);
...

Definition at line 473 of file wms_state.h.

◆ app_lib_state_scan_stop_f

typedef app_res_e(* app_lib_state_scan_stop_f) (void)

Stops ongoing scan operation before ended.

Returns
Normally APP_RES_OK. APP_RES_INVALID_CONFIGURATION if device is not APP_LIB_SETTINGS_ROLE_ADVERTISER nor APP_LIB_SETTINGS_ROLE_SUBNODE, APP_RES_RESOURCE_UNAVAILABLE if memory has ran out, APP_RES_INVALID_STACK_STATE if stack is not running.

This service aborts ongoing scan operation started with lib_state->startScanNbors().

Definition at line 597 of file wms_state.h.

◆ app_lib_state_set_on_beacon_cb_f

typedef 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.

Parameters
cbThe function to be executed, or NULL to unset
Returns
Result code, always APP_RES_OK

Definition at line 536 of file wms_state.h.

◆ app_lib_state_set_sink_cost_f

typedef app_res_e(* app_lib_state_set_sink_cost_f) (const uint8_t cost)

Set additional penalty for the sink usage.

This service can be used to inform the sink that the backend communication has problems. In order to keep the entire network operational, other nodes can be forced to use other sinks with working backend communication

Parameters
costValue of 0 means that connection is good and no additional penalty is sent to sink usage. Value of 254 includes maximum penalty
Returns
Result code, APP_RES_OK if successful, APP_RES_INVALID_CONFIGURATION if node is not a sink

Example on use:

lib_state->setSinkCost(8);

Definition at line 573 of file wms_state.h.

◆ app_lib_state_set_stack_event_cb_f

typedef app_res_e(* app_lib_state_set_stack_event_cb_f) (app_lib_state_on_stack_event_cb_f cb)

Register callback for stack events.

Parameters
cbFunction to be executed when a stack event listed in app_lib_stack_event_e happens

Definition at line 482 of file wms_state.h.

◆ app_lib_state_start_scan_nbors_f

typedef app_res_e(* app_lib_state_start_scan_nbors_f) (void)

Start neighbor scan.

This service can be used by the application to get fresh information about neighbors. Application can trigger to measurement all neighbors and once the measurement is done, application is informed it over API (see lib_state->setOnScanNborsCb service).

Returns
Result code, always APP_RES_OK unless stack is not running when APP_RES_INVALID_STACK_STATE is returned.

Example:

lib_state->startScanNbors();

Definition at line 501 of file wms_state.h.

◆ app_lib_state_start_stack_f

typedef app_res_e(* app_lib_state_start_stack_f) (void)

Start the stack.

This is most commonly used in the end of the App_init() function to start the radio operation.

Example:

void App_init(const app_global_functions_t * functions)
{
...
// Start the stack
lib_state->startStack();
}

In order to start, the stack needs minimum of four following attributes to be configured: device role, device address, network address and network channel. These attributes can be set by the application thanks to the Single-MCU API during the initialization step. Device role, network address and network channel can be hardcoded in the application image.

Returns
Result code, APP_RES_OK if successful

Definition at line 360 of file wms_state.h.

◆ app_lib_state_stop_stack_f

typedef app_res_e(* app_lib_state_stop_stack_f) (void)

Stop the stack.

Returns
Result code, APP_RES_OK if successful
Note
Stopping the stack will reboot the system. The state callback set with lib_state->setOnStackEventCb() is called just before rebooting with event APP_LIB_STATE_STACK_EVENT_STACK_STOPPED. Node configuration may be done in this callback
This function never returns

Example:

lib_state->stopStack();

Definition at line 378 of file wms_state.h.


Data Structure Documentation

◆ app_lib_state_nbor_info_t

struct app_lib_state_nbor_info_t

Neighbors info definition.

Definition at line 101 of file wms_state.h.

Data Fields
uint32_t address

Address of the neighbor node

uint8_t channel

Radio channel used by the neighbor

uint8_t cost

Route cost to the sink via this neighbor. Value of APP_LIB_STATE_INVALID_ROUTE_COST indicates that a neighbor has no route to a sink. Value of APP_LIB_STATE_COST_UNKNOWN states that cost is unknown for this neighbor.

uint8_t diradv_support

Is directed advertiser supported, app_lib_state_diradv_support_e

uint16_t last_update

Aount of seconds since these values were last updated.

uint8_t link_reliability

Link reliability to the neighboring node. Scaled so that 0 = 0 %, 255 = 100 %. Value of APP_LIB_STATE_LINKREL_UNKNOWN tells that link reliability to this neighbor is unknown.

int8_t norm_rssi

Received signal strength, compensated with transmission power, i.e. this value answers the question "what would the RSSI be, if the neighbor transmits with its maximum TX power". Larger value means better signal.

  • rssi < receiver sensitivity + 10 dB : Insufficient signal level
  • receiver sensitivity + 10 dB <= rssi < receiver_sensitivity + 20 dB : weak signal level
  • rssi >= receiver sensitivity + 20 dB : Good signal level.
    Note
    weak signal level is likely to work in environments without interference but the probability for connection problems in networks having some background interference then increases
int8_t rx_power

Transmission power used when neighbor sending to this device

Note
Only relevant for type having value of APP_LIB_STATE_NEIGHBOR_IS_NEXT_HOP or APP_LIB_STATE_NEIGHBOR_IS_MEMBER
int8_t tx_power

Transmission power used when sending to neighbor.

Note
Only relevant for type having value of APP_LIB_STATE_NEIGHBOR_IS_NEXT_HOP or APP_LIB_STATE_NEIGHBOR_IS_MEMBER
uint8_t type

Type of the neighbor. app_lib_state_nbor_type_e

◆ app_lib_state_nbor_list_t

struct app_lib_state_nbor_list_t

Neighbors list definition.

Definition at line 150 of file wms_state.h.

Data Fields
app_lib_state_nbor_info_t * nbors

Information of neighbors received

uint32_t number_nbors

Input: Maximum amount of neighbors in nbors field. Output: Amount of neighbors filled

◆ app_lib_state_beacon_rx_t

struct app_lib_state_beacon_rx_t

Structure to hold the information about received beacons.

Definition at line 198 of file wms_state.h.

Data Fields
app_addr_t address Address of the beacon sender.
uint8_t cost Cost of the device. 255==no route.
bool is_da_support Sender supports Directed Advertiser sending packets to it.
bool is_ll Device is LL.
bool is_sink Device is sink.
int8_t rssi RSSI in dBm.

Larger value means better signal.

  • rssi < receiver sensitivity + 10 dB : Insufficient signal level
  • receiver sensitivity + 10 dB <= rssi < receiver_sensitivity + 20 dB : weak signal level
  • rssi >= receiver sensitivity + 20 dB : Good signal level
    Note
    weak signal level is likely to work in environments without interference but the probability for connection problems in networks having some background interference then increases
int8_t txpower Tx power in dB This equals maximum transmission power that sender can transmit (which is used when transmitting beacons)
uint8_t type Type of beacon app_lib_state_beacon_type_e.

◆ app_lib_state_hops_adjust_t

struct app_lib_state_hops_adjust_t
Note
This struct is deprecated in Wirepas Mesh version 5.2.0 and later.

Definition at line 232 of file wms_state.h.

Data Fields
app_addr_t address
uint8_t hops_left

◆ app_lib_state_route_info_t

struct app_lib_state_route_info_t

Structure for route information.

Examples
ruuvi_evk/app.c.

Definition at line 241 of file wms_state.h.

Data Fields
app_lib_settings_net_channel_t channel

Next hop's (logical) data (cluster) channel or 0 if no valid route

uint8_t cost

Route cost or APP_LIB_STATE_INVALID_ROUTE_COST if no valid route

app_addr_t next_hop

Next hop's unicast address or 0 if no valid route

app_addr_t sink

Sink's unicast address or 0 if no valid route

app_lib_state_route_state_e state

Route state: invalid, pending or valid

◆ app_lib_state_install_quality_t

struct app_lib_state_install_quality_t

Installation quality information. Contains information about the nodes installation location i.e. its quality indicated by a numeric value, as well as error codes if something is wrong with the location.

For more detailed information about the value(s) presented here, see application note about installation quality API, document reference: https://developer.wirepas.com/support/solutions/articles/77000498319-radio-installation-quality-api-application-note

Definition at line 281 of file wms_state.h.

Data Fields
uint8_t error_codes

Error codes, install_quality_error_code_e

uint8_t quality

Quality reported as u8. Limits are as follows: Quality >= 127 : Good installation 127 > Quality > 63 : Average installation Quality <= 63 : Bad installation

◆ app_lib_state_on_scan_start_info_t

struct app_lib_state_on_scan_start_info_t

Information on started scan.

Definition at line 307 of file wms_state.h.

Data Fields
uint8_t scan_type

◆ app_lib_state_neighbor_scan_info_t

struct app_lib_state_neighbor_scan_info_t

Information on neighbor scan.

Definition at line 316 of file wms_state.h.

Data Fields
bool complete
app_lib_state_scan_type_e scan_type

◆ app_lib_state_t

struct app_lib_state_t

Enumeration Type Documentation

◆ app_lib_stack_event_e

List of event generated by the stack when registering to app_lib_state_set_stack_event_cb_f.

Note
Each event specifies the additionnal parameter associated to the event if it exists
Enumerator
APP_LIB_STATE_STACK_EVENT_STACK_STOPPED 

Stack has stopped. Param = NULL

APP_LIB_STATE_STACK_EVENT_STACK_STARTED 

Stack has started. Param = NULL

APP_LIB_STATE_STACK_EVENT_SCAN_STARTED 

A scan has started. Param = pointer to app_lib_state_on_scan_start_info_t

APP_LIB_STATE_STACK_EVENT_SCAN_STOPPED 

A scan has stoppedd. Param = pointer to app_lib_state_neighbor_scan_info_t

APP_LIB_STATE_STACK_EVENT_SCRAT_XFER_STARTED 

A scratchpad transfer (TX or RX) has started. It will prevent app from being scheduled for up to 30s. Param = NULL

APP_LIB_STATE_STACK_EVENT_SCRAT_XFER_STOPPED 

Scratchpad transfer is finished and app will be scheduled normaly. Param = NULL

APP_LIB_STATE_STACK_EVENT_ROUTE_CHANGED 

Route has changed. Param = pointer to app_lib_state_route_info_t

Definition at line 410 of file wms_state.h.

◆ app_lib_state_beacon_type_e

Type for beacons, passed in app_lib_state_beacon_rx_t.

Enumerator
APP_LIB_STATE_BEACON_TYPE_NB 

Network beacon.

APP_LIB_STATE_BEACON_TYPE_CB 

Cluster beacon.

Definition at line 189 of file wms_state.h.

◆ app_lib_state_diradv_support_e

Support type for directed advertiser, i.e. does neighbor support sending directed advertiser packets to it.

Enumerator
APP_LIB_STATE_DIRADV_SUPPORTED 

Directed advertiser is supported by neighbor and packet can be sent to it

APP_LIB_STATE_DIRADV_NOT_SUPPORTED 

Sending not supported by neighbor

APP_LIB_STATE_DIRADV_UNKNOWN 

Unknown state. Directed advertiser maybe or maybe not supported by neighbor but packet can not be sent to it

Definition at line 74 of file wms_state.h.

◆ app_lib_state_nbor_type_e

Neighbor type.

Note
Most reliable information is always from next hop and members Other entries might be very old
Enumerator
APP_LIB_STATE_NEIGHBOR_IS_NEXT_HOP 

Neighbor is specifically a next hop cluster, i.e. used as a route to sink

APP_LIB_STATE_NEIGHBOR_IS_MEMBER 

Neighbor is specifically a member of this node

APP_LIB_STATE_NEIGHBOR_IS_CLUSTER 

Neighbor is heard from network scan

Definition at line 59 of file wms_state.h.

◆ app_lib_state_route_state_e

Route state.

Enumerator
APP_LIB_STATE_ROUTE_STATE_INVALID 

No next hop / route.

APP_LIB_STATE_ROUTE_STATE_PENDING 

Acquiring next hop / route.

APP_LIB_STATE_ROUTE_STATE_VALID 

Valid next hop / route.

Definition at line 179 of file wms_state.h.

◆ app_lib_state_scan_nbors_type_e

Scan neighbor type to specify the scans that trigger the callback.

Enumerator
APP_LIB_STATE_SCAN_NBORS_ALL 

All scans will trigger the registered callback

APP_LIB_STATE_SCAN_NBORS_ONLY_REQUESTED 

Only explicitly requested scans from app will trigger the registered callback

Definition at line 89 of file wms_state.h.

◆ app_lib_state_scan_type_e

Types of scans.

Enumerator
SCAN_TYPE_APP_ORIGINATED 
SCAN_TYPE_STACK_ORIGINATED 

Definition at line 295 of file wms_state.h.

296 {
297  // Scan originated by application (by using call @ref
298  // app_lib_state_start_scan_nbors_f "lib_state->startScanNbors()")
300  // Scan originated by stack

◆ app_lib_state_stack_state_e

Stack state flags.

Enumerator
APP_LIB_STATE_STARTED 

Stack is started.

APP_LIB_STATE_STOPPED 

Stack is stopped.

APP_LIB_STATE_NODE_ADDRESS_NOT_SET 

Node address is not set.

APP_LIB_STATE_NETWORK_ADDRESS_NOT_SET 

Network address is not set.

APP_LIB_STATE_NETWORK_CHANNEL_NOT_SET 

Network channel is not set.

APP_LIB_STATE_ROLE_NOT_SET 

Node role is not set.

APP_LIB_STATE_APP_CONFIG_DATA_NOT_SET 

App config data is not set (sink only)

APP_LIB_STATE_ACCESS_DENIED 

Operation is not allowed.

Definition at line 163 of file wms_state.h.

◆ install_quality_error_code_e

Error codes for installation quality, if an error code is active, corrective action regarding the installation location is required.

Enumerator
APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONE 

No installation quality errors detected

APP_LIB_STATE_INSTALL_QUALITY_ERROR_NOROUTE 

Error: Node has no route to sink

APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONBORS 

Error: Node does not have enough good quality neighbors

APP_LIB_STATE_INSTALL_QUALITY_ERROR_BADRSSI 

Error: Node has bad RSSI to next hop neighbor

Definition at line 259 of file wms_state.h.

Macro Definition Documentation

◆ APP_LIB_STATE_COST_UNKNOWN

#define APP_LIB_STATE_COST_UNKNOWN   0

Macro for cost being unknown. Used in cost component in lib_state->getNbors() service.

Definition at line 44 of file wms_state.h.

◆ APP_LIB_STATE_INVALID_ROUTE_COST

#define APP_LIB_STATE_INVALID_ROUTE_COST   UINT8_MAX

Macro for cost indicating "no route". Used in cost component in lib_state->getNbors() service.

Definition at line 37 of file wms_state.h.

◆ APP_LIB_STATE_LINKREL_UNKNOWN

#define APP_LIB_STATE_LINKREL_UNKNOWN   0

Macro for link reliability being unknown. Used in link reliability component in lib_state->getNbors() service.

Definition at line 51 of file wms_state.h.

◆ APP_LIB_STATE_NAME

#define APP_LIB_STATE_NAME   0x02f9c165

Library symbolic name.

"STATE"

Definition at line 27 of file wms_state.h.

◆ APP_LIB_STATE_VERSION

#define APP_LIB_STATE_VERSION   0x20D

Maximum supported library version.

Definition at line 30 of file wms_state.h.

APP_LIB_STATE_NETWORK_ADDRESS_NOT_SET
@ APP_LIB_STATE_NETWORK_ADDRESS_NOT_SET
Network address is not set.
Definition: wms_state.h:168
APP_LIB_STATE_ROLE_NOT_SET
@ APP_LIB_STATE_ROLE_NOT_SET
Node role is not set.
Definition: wms_state.h:170
LVL_INFO
#define LVL_INFO
Definition: debug_log.h:83
app_lib_state_neighbor_scan_info_t::scan_type
app_lib_state_scan_type_e scan_type
Definition: wms_state.h:319
app_lib_state_beacon_type_e
app_lib_state_beacon_type_e
Type for beacons, passed in app_lib_state_beacon_rx_t.
Definition: wms_state.h:189
APP_LIB_STATE_NEIGHBOR_IS_CLUSTER
@ APP_LIB_STATE_NEIGHBOR_IS_CLUSTER
Definition: wms_state.h:67
APP_LIB_STATE_SCAN_NBORS_ALL
@ APP_LIB_STATE_SCAN_NBORS_ALL
Definition: wms_state.h:92
APP_LIB_STATE_INSTALL_QUALITY_ERROR_NOROUTE
@ APP_LIB_STATE_INSTALL_QUALITY_ERROR_NOROUTE
Definition: wms_state.h:264
APP_LIB_STATE_STACK_EVENT_SCRAT_XFER_STARTED
@ APP_LIB_STATE_STACK_EVENT_SCRAT_XFER_STARTED
Definition: wms_state.h:422
APP_LIB_STATE_STACK_EVENT_STACK_STARTED
@ APP_LIB_STATE_STACK_EVENT_STACK_STARTED
Definition: wms_state.h:415
APP_LIB_STATE_STACK_EVENT_SCRAT_XFER_STOPPED
@ APP_LIB_STATE_STACK_EVENT_SCRAT_XFER_STOPPED
Definition: wms_state.h:424
app_lib_stack_event_e
app_lib_stack_event_e
List of event generated by the stack when registering to app_lib_state_set_stack_event_cb_f.
Definition: wms_state.h:410
APP_LIB_STATE_STOPPED
@ APP_LIB_STATE_STOPPED
Stack is stopped.
Definition: wms_state.h:166
app_lib_state_scan_type_e
app_lib_state_scan_type_e
Types of scans.
Definition: wms_state.h:295
APP_LIB_STATE_NEIGHBOR_IS_NEXT_HOP
@ APP_LIB_STATE_NEIGHBOR_IS_NEXT_HOP
Definition: wms_state.h:63
APP_LIB_STATE_DIRADV_SUPPORTED
@ APP_LIB_STATE_DIRADV_SUPPORTED
Definition: wms_state.h:78
APP_LIB_STATE_DIRADV_NOT_SUPPORTED
@ APP_LIB_STATE_DIRADV_NOT_SUPPORTED
Definition: wms_state.h:80
APP_LIB_STATE_ACCESS_DENIED
@ APP_LIB_STATE_ACCESS_DENIED
Operation is not allowed.
Definition: wms_state.h:173
app_global_functions_t
List of global functions, passed to App_entrypoint()
Definition: wms_app.h:157
app_lib_state_diradv_support_e
app_lib_state_diradv_support_e
Support type for directed advertiser, i.e. does neighbor support sending directed advertiser packets ...
Definition: wms_state.h:74
app_lib_state_scan_nbors_type_e
app_lib_state_scan_nbors_type_e
Scan neighbor type to specify the scans that trigger the callback.
Definition: wms_state.h:89
APP_LIB_STATE_STARTED
@ APP_LIB_STATE_STARTED
Stack is started.
Definition: wms_state.h:165
SCAN_TYPE_APP_ORIGINATED
@ SCAN_TYPE_APP_ORIGINATED
Definition: wms_state.h:299
APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONBORS
@ APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONBORS
Definition: wms_state.h:266
app_lib_state_nbor_list_t
Neighbors list definition.
Definition: wms_state.h:150
install_quality_error_code_e
install_quality_error_code_e
Error codes for installation quality, if an error code is active, corrective action regarding the ins...
Definition: wms_state.h:259
APP_LIB_STATE_NODE_ADDRESS_NOT_SET
@ APP_LIB_STATE_NODE_ADDRESS_NOT_SET
Node address is not set.
Definition: wms_state.h:167
app_lib_state_route_state_e
app_lib_state_route_state_e
Route state.
Definition: wms_state.h:179
app_lib_state_neighbor_scan_info_t
Information on neighbor scan.
Definition: wms_state.h:316
APP_LIB_STATE_DIRADV_UNKNOWN
@ APP_LIB_STATE_DIRADV_UNKNOWN
Definition: wms_state.h:83
app_lib_state_nbor_list_t::number_nbors
uint32_t number_nbors
Definition: wms_state.h:155
APP_LIB_STATE_ROUTE_STATE_INVALID
@ APP_LIB_STATE_ROUTE_STATE_INVALID
No next hop / route.
Definition: wms_state.h:181
app_lib_state_nbor_type_e
app_lib_state_nbor_type_e
Neighbor type.
Definition: wms_state.h:59
APP_LIB_STATE_APP_CONFIG_DATA_NOT_SET
@ APP_LIB_STATE_APP_CONFIG_DATA_NOT_SET
Definition: wms_state.h:171
LOG
#define LOG(level, fmt,...)
Print a log message if its severity is lower or equal to DEBUG_LOG_MAX_LEVEL.
Definition: debug_log.h:172
APP_LIB_STATE_SCAN_NBORS_ONLY_REQUESTED
@ APP_LIB_STATE_SCAN_NBORS_ONLY_REQUESTED
Definition: wms_state.h:95
APP_LIB_STATE_BEACON_TYPE_CB
@ APP_LIB_STATE_BEACON_TYPE_CB
Cluster beacon.
Definition: wms_state.h:192
APP_LIB_STATE_ROUTE_STATE_PENDING
@ APP_LIB_STATE_ROUTE_STATE_PENDING
Acquiring next hop / route.
Definition: wms_state.h:182
APP_LIB_STATE_NETWORK_CHANNEL_NOT_SET
@ APP_LIB_STATE_NETWORK_CHANNEL_NOT_SET
Network channel is not set.
Definition: wms_state.h:169
app_lib_state_neighbor_scan_info_t::complete
bool complete
Definition: wms_state.h:321
SCAN_TYPE_STACK_ORIGINATED
@ SCAN_TYPE_STACK_ORIGINATED
Definition: wms_state.h:301
APP_LIB_STATE_BEACON_TYPE_NB
@ APP_LIB_STATE_BEACON_TYPE_NB
Network beacon.
Definition: wms_state.h:191
APP_LIB_STATE_STACK_EVENT_SCAN_STARTED
@ APP_LIB_STATE_STACK_EVENT_SCAN_STARTED
Definition: wms_state.h:417
app_lib_state_stack_state_e
app_lib_state_stack_state_e
Stack state flags.
Definition: wms_state.h:163
app_lib_state_nbor_info_t
Neighbors info definition.
Definition: wms_state.h:101
APP_LIB_STATE_STACK_EVENT_STACK_STOPPED
@ APP_LIB_STATE_STACK_EVENT_STACK_STOPPED
Definition: wms_state.h:413
APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONE
@ APP_LIB_STATE_INSTALL_QUALITY_ERROR_NONE
Definition: wms_state.h:262
APP_LIB_STATE_STACK_EVENT_SCAN_STOPPED
@ APP_LIB_STATE_STACK_EVENT_SCAN_STOPPED
Definition: wms_state.h:419
APP_LIB_STATE_STACK_EVENT_ROUTE_CHANGED
@ APP_LIB_STATE_STACK_EVENT_ROUTE_CHANGED
Definition: wms_state.h:426
APP_LIB_STATE_INSTALL_QUALITY_ERROR_BADRSSI
@ APP_LIB_STATE_INSTALL_QUALITY_ERROR_BADRSSI
Definition: wms_state.h:268
APP_LIB_STATE_ROUTE_STATE_VALID
@ APP_LIB_STATE_ROUTE_STATE_VALID
Valid next hop / route.
Definition: wms_state.h:183
APP_LIB_STATE_NEIGHBOR_IS_MEMBER
@ APP_LIB_STATE_NEIGHBOR_IS_MEMBER
Definition: wms_state.h:65