Mbed OS Reference
Loading...
Searching...
No Matches
WisunBorderRouter Class Reference

Wi-SUN Border Router class. More...

#include <WisunBorderRouter.h>

Public Member Functions

 WisunBorderRouter ()
 Create WisunBorderRouter. More...
 
mesh_error_t start (WisunInterface *mesh_if, NetworkInterface *backbone_if)
 Start Wi-SUN Border Router. More...
 
mesh_error_t start (NetworkInterface *mesh_if, NetworkInterface *backbone_if)
 Start Wi-SUN Border Router. More...
 
mesh_error_t start (WisunInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if)
 Start Wi-SUN Border Router. More...
 
mesh_error_t start (NetworkInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if)
 Start Wi-SUN Border Router. More...
 
void stop ()
 Stop Wi-SUN Border Router. More...
 
mesh_error_t set_rpl_parameters (uint8_t dio_interval_min, uint8_t dio_interval_doublings, uint8_t dio_redundancy_constant)
 Set Wi-SUN RPL DIO trickle parameters. More...
 
mesh_error_t get_rpl_parameters (uint8_t *dio_interval_min, uint8_t *dio_interval_doublings, uint8_t *dio_redundancy_constant)
 Get Wi-SUN RPL DIO trickle parameters. More...
 
mesh_error_t validate_rpl_parameters (uint8_t dio_interval_min, uint8_t dio_interval_doublings, uint8_t dio_redundancy_constant)
 Validate Wi-SUN RPL DIO trickle parameters. More...
 
mesh_error_t set_pan_configuration (uint16_t pan_id)
 Set Wi-SUN PAN configuration parameters. More...
 
mesh_error_t get_pan_configuration (uint16_t *pan_id)
 Get Wi-SUN PAN configuration parameters. More...
 
mesh_error_t validate_pan_configuration (uint16_t pan_id)
 Validate Wi-SUN PAN configuration parameters. More...
 
mesh_error_t info_get (ws_br_info_t *info_ptr)
 Get Wi-SUN Border Router information. More...
 
int routing_table_get (ws_br_route_info_t *table_ptr, uint16_t table_len)
 Get Wi-SUN neighbor table information. More...
 
mesh_error_t set_radius_server_ipv6_address (const char *address)
 Set Wi-SUN RADIUS server IPv6 address. More...
 
mesh_error_t get_radius_server_ipv6_address (char *address)
 Get Wi-SUN RADIUS server IPv6 address. More...
 
mesh_error_t set_radius_shared_secret (uint16_t shared_secret_len, const uint8_t *shared_secret)
 Set Wi-SUN RADIUS shared secret. More...
 
mesh_error_t get_radius_shared_secret (uint16_t *shared_secret_len, uint8_t *shared_secret)
 Get Wi-SUN RADIUS shared secret. More...
 
mesh_error_t set_radius_timing (ws_br_radius_timing_t *timing)
 Set Wi-SUN RADIUS timing parameters. More...
 
mesh_error_t get_radius_timing (ws_br_radius_timing_t *timing)
 Get Wi-SUN RADIUS timing parameters. More...
 
mesh_error_t validate_radius_timing (ws_br_radius_timing_t *timing)
 Validate Wi-SUN RADIUS timing parameters. More...
 
mesh_error_t set_dns_query_result (SocketAddress *address, char *domain_name)
 Set DNS query result to Nanostack cache. More...
 

Detailed Description

Wi-SUN Border Router class.

Class can be used to start, stop and configure Wi-SUN Border Router.

Definition at line 69 of file WisunBorderRouter.h.

Constructor & Destructor Documentation

◆ WisunBorderRouter()

Member Function Documentation

◆ start() [1/4]

mesh_error_t start ( WisunInterface mesh_if,
NetworkInterface backbone_if 
)

Start Wi-SUN Border Router.

Starts Wi-SUN Border Router and routing between the mesh and backbone interfaces. Network interfaces must be initialized and connected before calling the start. Backbone interface can be either Ethernet (EMAC) or Cellular.

Parameters
mesh_ifWi-SUN mesh network interface
backbone_ifBackbone network interface
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ start() [2/4]

mesh_error_t start ( NetworkInterface mesh_if,
NetworkInterface backbone_if 
)

Start Wi-SUN Border Router.

Starts Wi-SUN Border Router and routing between the mesh and backbone interfaces. Network interfaces must be initialized and connected before calling the start. Backbone interface can be either Ethernet (EMAC) or Cellular.

Parameters
mesh_ifWi-SUN mesh network interface
backbone_ifBackbone network interface
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ start() [3/4]

mesh_error_t start ( WisunInterface mesh_if,
OnboardNetworkStack::Interface backbone_if 
)

Start Wi-SUN Border Router.

Starts Wi-SUN Border Router and routing between the mesh and backbone interfaces. Mesh network interface must be initialized and connected before calling the start. Backbone OnboardNetworkStack::Interface must be brought up before calling the start. Backbone interface can be either Ethernet (EMAC) or Cellular (PPP).

Parameters
mesh_ifWi-SUN mesh network interface
backbone_ifBackbone OnboardNetworkStack::Interface interface
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ start() [4/4]

mesh_error_t start ( NetworkInterface mesh_if,
OnboardNetworkStack::Interface backbone_if 
)

Start Wi-SUN Border Router.

Starts Wi-SUN Border Router and routing between the mesh and backbone interfaces. Mesh network interface must be initialized and connected before calling the start. Backbone OnboardNetworkStack::Interface must be brought up before calling the start. Backbone interface can be either Ethernet (EMAC) or Cellular (PPP).

Parameters
mesh_ifWi-SUN mesh network interface
backbone_ifBackbone OnboardNetworkStack::Interface interface
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ stop()

void stop ( )

Stop Wi-SUN Border Router.

Stops Wi-SUN Border Router.

◆ set_rpl_parameters()

mesh_error_t set_rpl_parameters ( uint8_t  dio_interval_min,
uint8_t  dio_interval_doublings,
uint8_t  dio_redundancy_constant 
)

Set Wi-SUN RPL DIO trickle parameters.

Function stores new parameters to Border Router and uses them when mesh interface connect() is called next time. If device is already connected to the Wi-SUN network then device will restart Wi-SUN network after changing the RPL DIO trickle parameters. Mesh interface must be initialized before calling this function.

Parameters
dio_interval_minDIO trickle timer Imin parameter. Use 0x00 to use leave parameter unchanged.
dio_interval_doublingsDIO trickle timer Imax parameter as doublings of Imin. Use 0x00 to use leave parameter unchanged.
dio_redundancy_constantDIO trickle timer redundancy constant. Use 0xff to use leave parameter unchanged.
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ get_rpl_parameters()

mesh_error_t get_rpl_parameters ( uint8_t *  dio_interval_min,
uint8_t *  dio_interval_doublings,
uint8_t *  dio_redundancy_constant 
)

Get Wi-SUN RPL DIO trickle parameters.

Function reads DIO trickle timer Imin, DIO trickle timer Imax and DIO trickle timer redundancy constant from Border Router. Mesh interface must be initialized before calling this function.

Parameters
dio_interval_minDIO trickle timer Imin parameter.
dio_interval_doublingsDIO trickle timer Imax parameter as doublings of Imin.
dio_redundancy_constantDIO trickle timer redundancy constant.
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ validate_rpl_parameters()

mesh_error_t validate_rpl_parameters ( uint8_t  dio_interval_min,
uint8_t  dio_interval_doublings,
uint8_t  dio_redundancy_constant 
)

Validate Wi-SUN RPL DIO trickle parameters.

Function validates DIO trickle timer Imin, DIO trickle timer Imax and DIO trickle timer redundancy constant. Function can be used to test that values that will be used on set function are valid. Mesh interface must be initialized before the calling this function.

Parameters
dio_interval_minDIO trickle timer Imin parameter.
dio_interval_doublingsDIO trickle timer Imax parameter as doublings of Imin.
dio_redundancy_constantDIO trickle timer redundancy constant.
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ set_pan_configuration()

mesh_error_t set_pan_configuration ( uint16_t  pan_id)

Set Wi-SUN PAN configuration parameters.

Function stores new parameters to Border Router and uses them when mesh interface connect() is called next time. If device is already connected to the Wi-SUN network then device will restart Wi-SUN network after changing the PAN configuration parameters. Mesh interface must be initialized before calling this function.

Parameters
pan_idPAN ID. 0xffff will generate the PAN ID on the mesh interface connect() call if not already generated.
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ get_pan_configuration()

mesh_error_t get_pan_configuration ( uint16_t *  pan_id)

Get Wi-SUN PAN configuration parameters.

Function reads PAN ID from Border Router. Mesh interface must be initialized before calling this function.

Parameters
pan_idPAN ID.
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ validate_pan_configuration()

mesh_error_t validate_pan_configuration ( uint16_t  pan_id)

Validate Wi-SUN PAN configuration parameters.

Function validates PAN ID. Function can be used to test that values that will be used on set function are valid. Mesh interface must be initialized before calling this function.

Parameters
pan_idPAN ID.
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ info_get()

mesh_error_t info_get ( ws_br_info_t info_ptr)

Get Wi-SUN Border Router information.

Function reads RPL information from Border Router. Mesh interface must be initialized before calling this function.

Parameters
info_ptrStructure given to stack where information will be stored
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ routing_table_get()

int routing_table_get ( ws_br_route_info_t table_ptr,
uint16_t  table_len 
)

Get Wi-SUN neighbor table information.

Function reads Routing Table information from Border Router. Table is Parent child relation using the Global address IID of the devices. To get the full IPv6 address of the device, IPv6 = Global Prefix + IID. Mesh interface must be initialized before calling this function.

Parameters
table_ptrApplication allocated memory block where routing table is written.
table_lenLength of the table allocated by application given as amount of entries.
Returns
0 - x on success indicates number of entries written to the table_ptr.
<0 in case of errors.

◆ set_radius_server_ipv6_address()

mesh_error_t set_radius_server_ipv6_address ( const char *  address)

Set Wi-SUN RADIUS server IPv6 address.

Function sets external RADIUS server IPv6 address to Border Router. Setting the address enables external RADIUS server interface on Border Router. To disable external RADIUS server interface, call the function with address set to NULL. The RADIUS shared secret must be set before address is set using set_radius_shared_secret() call.

Parameters
addressPointer to IPv6 address string or NULL to disable RADIUS. Address string format is e.g. 2001:1234::1 and it is NUL terminated.
Returns
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of failure.

◆ get_radius_server_ipv6_address()

mesh_error_t get_radius_server_ipv6_address ( char *  address)

Get Wi-SUN RADIUS server IPv6 address.

Function gets external RADIUS server IPv6 address from Border Router.

Parameters
addressPointer to buffer where to write IPv6 address string. Must have space at least for 39 characters and NUL terminator.
Returns
MESH_ERROR_NONE on success.
error value in case of failure, e.g. if address has not been set to Border Router.

◆ set_radius_shared_secret()

mesh_error_t set_radius_shared_secret ( uint16_t  shared_secret_len,
const uint8_t *  shared_secret 
)

Set Wi-SUN RADIUS shared secret.

Function sets RADIUS shared secret to Border Router. Shared secret may be an ASCII string. Check the format and length constraints for the shared secret from the documentation of RADIUS server you are connecting to.

Parameters
shared_secret_lenThe length of the shared secret in bytes.
shared_secretPointer to shared secret. Can be 8-bit ASCII string or byte array. Is not NUL terminated.
Returns
MESH_ERROR_NONE on success.
error value in case of failure.

◆ get_radius_shared_secret()

mesh_error_t get_radius_shared_secret ( uint16_t *  shared_secret_len,
uint8_t *  shared_secret 
)

Get Wi-SUN RADIUS shared secret.

Function gets RADIUS shared secret from Border Router.

Parameters
shared_secret_lenOn function call, is the size of the shared secret write buffer in bytes, on return is the shared secret length in bytes.
shared_secretPointer to buffer where to write shared secret or NULL. At maximum, bytes set by the length parameter are written. If NULL only buffer length is returned.
Returns
MESH_ERROR_NONE on success.
error value in case of failure.

◆ set_radius_timing()

mesh_error_t set_radius_timing ( ws_br_radius_timing_t timing)

Set Wi-SUN RADIUS timing parameters.

Function sets RADIUS timing parameters to Border Router. For RADIUS retry trickle timer default settings are that the first retry is done between 1 to 3 seconds after the initial attempt and all retries are done in maximum in 9 seconds.

Parameters
timingTiming parameters.
Returns
MESH_ERROR_NONE on success.
error value in case of failure.

◆ get_radius_timing()

mesh_error_t get_radius_timing ( ws_br_radius_timing_t timing)

Get Wi-SUN RADIUS timing parameters.

Function gets RADIUS timing parameters from Border Router.

Parameters
timingTiming parameters.
Returns
MESH_ERROR_NONE on success.
error value in case of failure.

◆ validate_radius_timing()

mesh_error_t validate_radius_timing ( ws_br_radius_timing_t timing)

Validate Wi-SUN RADIUS timing parameters.

Function validates RADIUS timing parameters on Border Router.

Parameters
timingTiming parameters.
Returns
MESH_ERROR_NONE on success.
error value in case of failure.

◆ set_dns_query_result()

mesh_error_t set_dns_query_result ( SocketAddress address,
char *  domain_name 
)

Set DNS query result to Nanostack cache.

Function sets DNS query result to Nanostack cache to get distributed to the devices in the Wi-SUN network. Function must be called for a running Wi-SUN Border Router instance.

Parameters
addressresolved address of domain_name.
domain_namename of the domain. Must be non-NULL.
Returns
MESH_ERROR_NONE on success.
error value in case of failure.