Morse Micro IoT SDK  2.13.1
WLAN Control API for S1G Relay functionality

Detailed Description

API for configuration and control of S1G Relay.

Warning
ALPHA NOTICE: This is an alpha API that is under development. It is not intended for production use. It may be removed in a future release and/or breaking changes may be introduced.

Data Structures

struct  mmwlan_relay_args
 Arguments data structure for mmwlan_relay_enable(). More...
 

Macros

#define MMWLAN_RELAY_DEFAULT_FORWARDING_TABLE_SIZE   (64)
 Default value for the forwarding_table_size member of mmwlan_relay_args. More...
 
#define MMWLAN_RELAY_ARGS_INIT
 Initializer for mmwlan_relay_args. More...
 
#define MMWLAN_RELAY_MAX_DEPTH   8
 Maximum valid relay depth. More...
 
#define MMWLAN_RELAY_DEPTH_UNKNOWN   UINT8_MAX
 Relay depth value returned when the depth is unknown. More...
 

Typedefs

typedef void(* mmwlan_relay_depth_change_cb_t) (uint8_t new_depth, void *arg)
 Relay depth change callback function prototype. More...
 

Enumerations

enum  mmwlan_relay_state { MMWLAN_RELAY_STATE_DISABLED , MMWLAN_RELAY_STATE_STA , MMWLAN_RELAY_STATE_RELAY , MMWLAN_RELAY_STATE_ROOT }
 Enumeration of S1G Relay states. More...
 

Functions

enum mmwlan_status mmwlan_register_depth_change_cb (mmwlan_relay_depth_change_cb_t callback, void *arg)
 Register a relay depth change callback for use in relay mode. More...
 
enum mmwlan_status mmwlan_relay_enable (const struct mmwlan_relay_args *args)
 Enable S1G Relay mode. More...
 
enum mmwlan_status mmwlan_relay_set_depth_override (uint8_t depth)
 Set the S1G Relay depth override. More...
 
enum mmwlan_status mmwlan_relay_disable (void)
 Disable S1G Relay mode. More...
 
enum mmwlan_relay_state mmwlan_relay_get_state (void)
 Get the current S1G Relay state. More...
 
uint8_t mmwlan_relay_get_depth (void)
 Get the current S1G Relay depth. More...
 

Macro Definition Documentation

◆ MMWLAN_RELAY_ARGS_INIT

#define MMWLAN_RELAY_ARGS_INIT
Value:
{ \
.forwarding_table_size = 0, \
.is_root_node = false, \
}

Initializer for mmwlan_relay_args.

See also
mmwlan_relay_args

Definition at line 2324 of file mmwlan.h.

◆ MMWLAN_RELAY_DEFAULT_FORWARDING_TABLE_SIZE

#define MMWLAN_RELAY_DEFAULT_FORWARDING_TABLE_SIZE   (64)

Default value for the forwarding_table_size member of mmwlan_relay_args.

Definition at line 2265 of file mmwlan.h.

◆ MMWLAN_RELAY_DEPTH_UNKNOWN

#define MMWLAN_RELAY_DEPTH_UNKNOWN   UINT8_MAX

Relay depth value returned when the depth is unknown.

Definition at line 2406 of file mmwlan.h.

◆ MMWLAN_RELAY_MAX_DEPTH

#define MMWLAN_RELAY_MAX_DEPTH   8

Maximum valid relay depth.

Definition at line 2348 of file mmwlan.h.

Typedef Documentation

◆ mmwlan_relay_depth_change_cb_t

typedef void(* mmwlan_relay_depth_change_cb_t) (uint8_t new_depth, void *arg)

Relay depth change callback function prototype.

Parameters
new_depthCurrent depth of the relay node after the change cb was triggered.
argOpaque argument to be passed to the callback.

Definition at line 2273 of file mmwlan.h.

Enumeration Type Documentation

◆ mmwlan_relay_state

Enumeration of S1G Relay states.

Enumerator
MMWLAN_RELAY_STATE_DISABLED 

Relay mode is not enabled.

MMWLAN_RELAY_STATE_STA 

Relay is enabled on a non-root node whose AP interface is not yet up (STA only).

MMWLAN_RELAY_STATE_RELAY 

Relay is enabled on a non-root node whose AP interface is up, relaying for children.

MMWLAN_RELAY_STATE_ROOT 

Relay is enabled on the root node of the relay tree.

Definition at line 2382 of file mmwlan.h.

Function Documentation

◆ mmwlan_register_depth_change_cb()

enum mmwlan_status mmwlan_register_depth_change_cb ( mmwlan_relay_depth_change_cb_t  callback,
void *  arg 
)

Register a relay depth change callback for use in relay mode.

Warning
ALPHA NOTICE: This is an alpha API that is under development; breaking changes may be introduced in future releases.
Parameters
callbackThe callback to register.
argOpaque argument to be passed to the callback.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_relay_disable()

enum mmwlan_status mmwlan_relay_disable ( void  )

Disable S1G Relay mode.

Warning
ALPHA NOTICE: This is an alpha API that is under development; breaking changes may be introduced in future releases.
Returns
MMWLAN_SUCCESS on success, MMWLAN_NOT_SUPPORTED if S1G Relay support was not enabled at build time, or another appropriate error code.

◆ mmwlan_relay_enable()

enum mmwlan_status mmwlan_relay_enable ( const struct mmwlan_relay_args *  args)

Enable S1G Relay mode.

The relay mode must be enabled prior to enabling the STA or AP, to ensure the device connects to the relay network with relay awareness.

Warning
ALPHA NOTICE: This is an alpha API that is under development; breaking changes may be introduced in future releases.
Parameters
argsArguments from application.
Returns
MMWLAN_SUCCESS on success, MMWLAN_NOT_SUPPORTED if S1G Relay support was not enabled at build time, MMWLAN_INVALID_ARGUMENT if arguments are invalid, or another appropriate error code.

◆ mmwlan_relay_get_depth()

uint8_t mmwlan_relay_get_depth ( void  )

Get the current S1G Relay depth.

The depth is the number of links between this device and the root node.

Warning
ALPHA NOTICE: This is an alpha API that is under development; breaking changes may be introduced in future releases.
Returns
The current relay depth, or MMWLAN_RELAY_DEPTH_UNKNOWN if the depth is unknown because relay is not active or the node has no path to the root.

◆ mmwlan_relay_get_state()

enum mmwlan_relay_state mmwlan_relay_get_state ( void  )

Get the current S1G Relay state.

Warning
ALPHA NOTICE: This is an alpha API that is under development; breaking changes may be introduced in future releases.
Returns
The current mmwlan_relay_state. Returns MMWLAN_RELAY_STATE_DISABLED if S1G Relay support was not enabled at build time or relay is not currently enabled.

◆ mmwlan_relay_set_depth_override()

enum mmwlan_status mmwlan_relay_set_depth_override ( uint8_t  depth)

Set the S1G Relay depth override.

A depth of 0 clears any configured override.

Warning
ALPHA NOTICE: This is an alpha API that is under development; breaking changes may be introduced in future releases.
Note
This is a test API and is not intended for use outside of testing.
Only valid while STA and AP are both disabled.
Parameters
depthRelay depth override, max value of MMWLAN_RELAY_MAX_DEPTH.
Returns
MMWLAN_SUCCESS; MMWLAN_UNAVAILABLE if STA/AP active; MMWLAN_INVALID_ARGUMENT if depth is out of range.