4.1.5 BDB Generic

This set of functions consists of generic operations that set or retrieve the BDB device properties.
  • The user can set the channel mask for either the bdbPrimaryChannelSet or bdbSecondaryChannelSet attribute by using the following public API.
    void BDB_SetChannelMask(BDB_ChannelMaskType_t type, uint32_t channelMask);

    Parameters:

    • type – Type of channel mask primary/secondary
    • channelMask – Value of channel mask
  • Use the following public API to get either the bdbPrimaryChannelSet or bdbSecondaryChannelSet attribute.
    uint32_t BDB_GetChannelMask(BDB_ChannelMaskType_t type);

    Parameters:

    • type – Type of channel mask primary/secondary

    Returns:

    • The value of the channel mask based on the type passed

  • Use the following public API to set the Trust Center Link Key (TCLK) for the BDB attribute. This API applies to both the router and the end device. The bdbTCLinkKeyExchangeMethod attribute determines the method for establishing a new link key after joining the network and can be set to one of the non-reserved values.
    void BDB_SetTCLKExchangeMethod(uint8_t exchangeMethod);

    Parameters:

    • exchangeMethod – Type of the TCLK exchange method TC_LINKKEY_EXCHANGE_METHOD_APS_REQ_KEY(0x00) or TC_LINKKEY_EXCHANGE_METHOD_CBKE(0x01-unsupported)
  • The user can set the number of key establishment attempts to establish a new link key after joining by using the following public API.
    void BDB_SetTCLKRetryMaxAttempts(uint8_t attempts);

    Parameters:

    • attempts – Number of max retry attempts
  • Use the following public API to get the bdbNodeCommissioningCapability attribute, which defines the capabilities supported by the device, such as network formation, finding and binding, Touchlink commissioning and more.
    BDB_NodeCommissioningCapability_t BDB_GetCommissioningCapability(void);

    Parameters:

    • None
  • Use the following public API to set the bdbJoinUsesInstallCodeKey attribute, which configures whether to block or allow devices that match the default installation code with the Trust Center.
    void BDB_SetInstallCodeUsage (bool useInstallCode);

    Parameters:

    • useInstallCode – True or false
  • Use the following public API to set the bdbTrustCenterNodeJoinTimeout attribute. This attribute specifies the timeout in seconds for the Trust Center to remove the Trust Center link key if a newly joined node fails to establish a new link key successfully.
    void BDB_SetNodeJoinTimeout (uint8_t timeOutInSec);

    Parameters:

    • timeOutInSec – Timeout in seconds
  • Use the following API to set the BDB IB attribute bdbTrustCenterRequireKeyExchange, which specifies whether the trust center requires a joining device to exchange its initial link key with a new link key generated by the Trust Center.
    void BDB_SetTCRequireKeyExchange (bool requireKeyExchange);

    Parameters:

    • requireKeyExchange – True or false
  • Use the following API to configure whether BDB must support the touch link role.
    void BDB_SetToulinkRole(bool initiator);

    Parameters:

    • initiator – True
    • target – False
  • The API retrieves the bdbNodeIsOnANetwork attribute to determine whether it is part of a network. It returns true if the node is in the network and false otherwise.
    bool BDB_GetBdbNodeIsOnANetwork(void);

    Parameters:

    • None
  • Use the following API to set the bdbNodeIsOnANetwork attribute based on whether the node is part of a network.
    void BDB_SetBdbNodeIsOnANetwork(bool onNetwork);

    Parameters:

    • onNetwork – True for on network
    • Otherwise – False
  • The following API sets the flag for touch link to perform Reset to factory new if allow is true.
    void BDB_SetAllowTLResetToFN(bool allow);

    Parameters:

    • allow – True or false
  • Use the following public API to reset the BDB component information base/attributes to default values if the device is not in a network.
    void BDB_ResetIB(void);

    Parameters:

    • None
  • Use the following API to subscribe to the events from the BDB module and their callback handlers from the application.
    void BDB_EventsSubscribe(const BdbEventSubscriber_t  *subscriber);

    Parameters:

    • BdbEventSubscriber_t - It is a structure of function handlers for the events subscribed.
      For example, fill out the event subscriber structure as the following and pass it to the BDB_EventsSubscribe API.
      BdbEventSubscriber_t s_BDB_EventsCallback =
      {
       .connected = Connected,
       .disconnected = Disconnected,
       .identifyStartIndication = IdentifyStartIndication,
       .identifyStopIndication = IdentifyStopIndication,
       .updateNetworkIndication = UpdateNetworkIndication,
       .queryingCompleted = QeryingCompleted,
       .joinNetworkIndication = JoinNetworkIndication,
       .SteeringNetwork = NULL,
       .tclkProcedureOngoing = NULL,
       .tclkProcedureCompleted = NULL,
       .addingBindingLinks = NULL,
       .scanIndication = NULL,
       .touchlinkCompleted = TouchlinkCompleted,
       .networkFormationCompleted = NetworkFormationCompleted,
       .SteeringCompleted = NetworkSteeringCompleted,
       .findingBindingCompleted = FindingBindingCompleted,
       .ResetToFactoryDefaults = ResetToFactoryDefaults,
       .querying = Querying, 
       .scanning = Scanning,
       .identifying = Identifying,
       .joining = Joining,
       .findingBindingInitiatorModeCompleted = FindingBindingInitiatorModeCompleted,
      };
      // Subscribing to different bdb events with specified callbacks
       BDB_EventsSubscribe(&s_BDB_EventsCallback);