Main Content

bluetoothConnectionConfig

Bluetooth BR connection configuration parameters

    Description

    Use the bluetoothConnectionConfig object to set the baseband connection configuration parameters for a Bluetooth® basic rate (BR) Central and Peripheral node pair.

    Creation

    Description

    example

    cfgConnection = bluetoothConnectionConfig creates a default Bluetooth BR connection configuration object that shares the baseband connection configuration parameters between a Central and a Peripheral node.

    cfgConnection = bluetoothConnectionConfig(Name=Value) sets properties by using one or more name-value arguments. For example, HoppingSequenceType="Connection adaptive" sets the frequency hopping sequence type to "Connection adaptive".

    Properties

    expand all

    Packet type used over the asynchronous connection-oriented logical (ACL) logical transport from Central to Peripheral node, specified as "DH1", "DM1", "DM3", "DH3", "DM5", or "DH5".

    Data Types: char | string

    Packet type used over ACL logical transport from Peripheral to Central node, specified as "DH1", "DM1", "DM3", "DH3", "DM5", or "DH5".

    Data Types: char | string

    Packet type transmitted and received over the synchronous connection-oriented (SCO) logical transport, specified as "None", "HV1", "HV2", or "HV3". If you set this property to "None", the object disables the SCO link, and no voice transmission occurs between the Bluetooth BR nodes. If you set this property to "HV1", "HV2", or "HV3", the object enables the synchronous link. Based on the configured SCO packet type, the Bluetooth BR node internally generates voice traffic with a data rate of 64 Kbps. To send "DV" packets over the SCO link, perform these steps.

    1. Set this property to "HV1".

    2. Attach an ACL traffic source for the data payload with a packet size in the range of [1, 9] bytes.

    The object supports one SCO link in a physical link and up to three SCO links at the Central node.

    Data Types: char | string

    Frequency hopping sequence type, specified as "Connection basic" or "Connection adaptive".

    Data Types: char | string

    List of used (good) data channels for the Bluetooth BR physical link to use, specified as a vector of integers in the range [0, 78]. This value specifies the indices of the assigned data channels. To ensure that at least 20 channels are set as used (good) channels, specify this vector with unique values and a length greater than or equal to 20.

    Dependencies

    To enable this property, set the HoppingSequenceType property to "Connection adaptive".

    Data Types: double

    Maximum interval between two successive poll requests, specified as an integer in the range [6, 4096]. Set this value in number of slots. For more information about this property, see the Bluetooth Core Specification [2], Volume 2, Part C, Section 5.4.

    Data Types: double

    Slots after which the new channel map is enforced, specified as an integer in the range [96, 69120000]. The object adds this value to the current clock and updates the channel map. Units are in slots. This value must be at least PollInterval slots or 96 slots, whichever is greater.

    Dependencies

    To enable this property, set the HoppingSequenceType property to "Connection adaptive".

    Data Types: double

    Packet transmission power, specified as a scalar in the range [–20, 20]. The transmitter applies this value on the packet before sending it to the antenna. Units are in dBm.

    Data Types: double

    Connection supervision timeout, specified as a scalar in the range [400, 65535] or Inf. Units are in slots.

    • If the Bluetooth BR node does not receive a valid packet within the time set by this value, the object times out the connection. After the timeout, the logical link is disconnected at the baseband layer and no connection exists between the nodes.

    • If you set this value to Inf, the connection is always active.

    Data Types: double

    This property is read-only.

    Bluetooth BR Central node address, stored as a 12-element character vector or a string scalar denoting a 6-octet hexadecimal value. This property sets a unique address for the Bluetooth BR Central node.

    Data Types: char | string

    This property is read-only.

    Primary logical transport address, stored as a positive integer scalar.

    Data Types: double

    Object Functions

    expand all

    configureConnectionConfigure connection between Bluetooth BR Central and Peripheral nodes

    Examples

    collapse all

    Initialize the wireless network simulator.

    networkSimulator = wirelessNetworkSimulator.init();

    Create two Bluetooth BR nodes, one with the "central" role and the other with the "peripheral" role. Specify the position of the Peripheral node, in meters.

    centralNode = bluetoothNode("central");
    peripheralNode = bluetoothNode("peripheral",Position=[1 0 0]);

    Create a default Bluetooth BR connection configuration object to configure and share a connection between the Bluetooth BR Central and Peripheral nodes.

    cfgConnection = bluetoothConnectionConfig;

    Configure the connection between the Central and the Peripheral nodes.

    connection = configureConnection(cfgConnection,centralNode,peripheralNode)
    connection = 
      bluetoothConnectionConfig with properties:
    
        CentralToPeripheralACLPacketType: "DH1"
        PeripheralToCentralACLPacketType: "DH1"
                           SCOPacketType: "None"
                     HoppingSequenceType: "Connection adaptive"
                            UsedChannels: [0 1 2 3 4 5 6 7 8 9 10 11 12 13 ... ]
                            PollInterval: 40
                           InstantOffset: 240
                        TransmitterPower: 20
                      SupervisionTimeout: 32000
    
       Read-only properties:
                          CentralAddress: "D091BBE70001"
                        PrimaryLTAddress: 1
    
    

    Create and configure a networkTrafficOnOff object to generate an On-Off application traffic pattern.

    traffic = networkTrafficOnOff(DataRate=200,PacketSize=27, ...
        GeneratePacket=true,OnTime=inf);

    Add application traffic from the Central to the Peripheral node.

    addTrafficSource(centralNode,traffic,DestinationNode=peripheralNode);

    Add the Central and Peripheral nodes to the wireless network simulator.

    addNodes(networkSimulator,[centralNode peripheralNode]);

    Specify the simulation time, in seconds.

    simulationTime = 0.3;

    Run the simulation for the specified simulation time.

    run(networkSimulator,simulationTime);
    Custom channel model is not added. Using free space path loss (fspl) model as the default channel model.
    

    Retrieve the application, baseband, and physical layer (PHY) statistics corresponding to the Central and Peripheral nodes.

    centralStats = statistics(centralNode)
    centralStats = struct with fields:
            Name: "Node1"
              ID: 1
             App: [1x1 struct]
        Baseband: [1x1 struct]
             PHY: [1x1 struct]
    
    
    peripheralStats = statistics(peripheralNode)
    peripheralStats = struct with fields:
            Name: "Node2"
              ID: 2
             App: [1x1 struct]
        Baseband: [1x1 struct]
             PHY: [1x1 struct]
    
    

    References

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

    [2] Bluetooth Core Specifications Working Group. "Bluetooth Core Specification" v5.3. https://www.bluetooth.com/.

    Version History

    Introduced in R2022b