Main Content

bluetoothMeshFriendshipConfig

Bluetooth mesh friendship configuration parameters

Since R2022a

    Description

    Use the bluetoothMeshFriendshipConfig object to set the mesh friendship configuration between a Friend node and a low power node (LPN) based on Bluetooth Mesh Profile v1.0.1 [3].

    Creation

    Description

    cfgMeshFriendship = bluetoothMeshFriendhshipConfig creates a default Bluetooth® mesh friendship configuration object.

    example

    cfgMeshFriendship = bluetoothMeshFriendshipConfig(Name=Value) sets properties by using one or more name-value arguments. For example, PollTimeout=2sets the timeout for terminating the friendship between Friend node and LPN to 2 seconds.

    Properties

    expand all

    Receive delay requested by the LPN, specified as a scalar in the range [0.01, 0.255]. Specify this value in seconds. Set this value as an integer multiple of 1 milliseconds. This value specifies the time interval between when the LPN sends a request to the friend node and when the LPN listens for a response from the friend node. For more information about receive delay, see Section 3.6.5.3 of Bluetooth Mesh Profile v1.0.1 [3].

    Data Types: double

    Receive window supported by the Friend node, specified as a scalar in the range [0.001, 0.255]. Specify this value in seconds. Set this value as an integer multiple of 1 milliseconds. This value specifies the amount of time that the LPN listens for a response (data or update message) from the Friend node. For more information about receive window, see Section 3.6.5.4 of Bluetooth Mesh Profile v1.0.1 [3].

    Data Types: double

    Timeout to terminate friendship between the Friend node and LPN, specified as a scalar in the range [1, 345599.9]. Specify this value in seconds. Set this value as multiples of 100 milliseconds. This value specifies the maximum time allowed between two consecutive requests sent by the LPN to the Friend node to terminate the friendship. If the Friend node receives no request from the LPN within this value, this object terminates the friendship between the LPN and Friend node. For more information about poll timeout, see Section 3.6.5.3 of Bluetooth Mesh Profile v1.0.1 [3].

    Data Types: double

    Object Functions

    expand all

    configureFriendshipConfigure friendship between Friend node and LPN

    Examples

    collapse all

    Check if the Communications Toolbox™ Wireless Network Simulation Library support package is installed. If the support package is not installed, MATLAB® returns an error with a link to download and install the support package.

    wirelessnetworkSupportPackageCheck;

    Create a Bluetooth mesh profile configuration object, specifying the element address and enabling the Friend feature of the Friend node.

    meshFriendshipCfg = bluetoothMeshProfileConfig(ElementAddress="000A",Friend=true)
    meshFriendshipCfg = 
      bluetoothMeshProfileConfig with properties:
    
                 ElementAddress: "000A"
                          Relay: 0
                         Friend: 1
                       LowPower: 0
           NetworkTransmissions: 1
        NetworkTransmitInterval: 0.0100
                            TTL: 127
    
    

    Create a Bluetooth mesh profile configuration object for an LPN, specifying the element address and enabling the low power feature of the LPN.

    meshLPNCfg = bluetoothMeshProfileConfig(ElementAddress="000F",LowPower=true)
    meshLPNCfg = 
      bluetoothMeshProfileConfig with properties:
    
                 ElementAddress: "000F"
                          Relay: 0
                         Friend: 0
                       LowPower: 1
           NetworkTransmissions: 1
        NetworkTransmitInterval: 0.0100
                            TTL: 127
    
    

    Create a Bluetooth mesh node with the friend feature enabled. Specify the role as "broadcaster-observer" and assign the mesh profile configuration.

    meshFriendNode = bluetoothLENode("broadcaster-observer",MeshConfig=meshFriendshipCfg);

    Create a Bluetooth mesh node with the low power feature enabled. Specify the role as "broadcaster-observer" and assign the mesh profile configuration.

    meshLPN = bluetoothLENode("broadcaster-observer",MeshConfig=meshLPNCfg);

    Create a default Bluetooth mesh friendship configuration object. Specify the poll timeout, receive window supported by the Friend node, and receive delay requested by the LPN.

    friendshipConfig = bluetoothMeshFriendshipConfig;
    friendshipConfig.PollTimeout = 3;                     % In seconds
    friendshipConfig.ReceiveWindow = 0.180;               % In seconds
    friendshipConfig.ReceiveDelay = 0.05                  % In seconds
    friendshipConfig = 
      bluetoothMeshFriendshipConfig with properties:
    
         ReceiveDelay: 0.0500
        ReceiveWindow: 0.1800
          PollTimeout: 3
    
    

    Configure friendship between the Friend node and LPN.

    configureFriendship(friendshipConfig,meshFriendNode,meshLPN);

    References

    [1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 22, 2021. https://www.bluetooth.com/.

    [2] Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification." Version 5.3. https://www.bluetooth.com/.

    [3] Bluetooth Special Interest Group (SIG). "Bluetooth Mesh Profile". v1.0.1. https://www.bluetooth.com/.

    Version History

    Introduced in R2022a