BDB_eNsStartNwkSteering

BDB_teStatus BDB_eNsStartNwkSteering(void);

Description

This function starts the Network Steering process and, if necessary, must be called after BDB_vStart(). If it is potentially required on a node, enable Network Steering via the attribute u8bdbCommissioningMode.

The actions performed by this function depend on whether the local node is already a member of a network:

  • When the node is already in a network and is a Coordinator or Router, it opens up the network for other nodes to join. This action is for a fixed time-interval of 180 seconds by default, but this interval can be configured (in seconds) using the macro BDBC_MIN_COMMISSIONING_TIME in the bdb_options.h file.

  • When the node is not already in a network, it searches for a suitable network to join. If it finds one, attempts to join the network. Once a node has joined the network, the node is authenticated and receives the network key from its parent. If the network has a Trust Centre, the node may then replace its pre-configured link key with one generated and supplied by the Trust Centre.

Once Network Steering starts, the function returns and the eventual outcome of the Network Steering process is indicated by an asynchronous event - one of the following:

  • BDB_EVENT_NWK_STEERING_SUCCESS if Network Steering has been completed successfully.

  • BDB_EVENT_NO_NETWORK if no open network was discovered for joining.

  • BDB_EVENT_NWK_JOIN_FAILURE if the node attempted to join a network but failed.

Network Steering is described in more detail in Network steering.

Parameters

  • None

Returns

  • BDB_E_SUCCESS

    (Network Steering has been successfully started)*.

  • BDB_E_ERROR_IMPROPER_COMMISSIONING_MODE

    (Network Steering is not enabled).

  • BDB_E_ERROR_COMMISSIONING_IN_PROGRESS

    (node is already in a commissioning mode).

  • BDB_E_ERROR_INVALID_DEVICE

    (joining node is a Coordinator).

The eventual outcome is indicated by a BDB_EVENT_NWK_STEERING_SUCCESS, BDB_EVENT_NO_NETWORK, or BDB_EVENT_NWK_JOIN_FAILURE event, as described above.

Parent topic:Functions