Main Content

bluetoothNode

Bluetooth BR node

    Description

    Use the bluetoothNode object to create and configure a Bluetooth® basic rate (BR) node.

    Creation

    Description

    BRNode = bluetoothNode(Role) creates a default Bluetooth BR node object for the specified role Role. The Role argument sets the value of the Role property.

    example

    BRNode = bluetoothNode(Role,Name=Value) sets properties of the Bluetooth BR node object by using one or more optional name-value arguments. For example, "central",NoiseFigure=5 sets the noise figure of the specified node to 5 dB.

    Properties

    expand all

    Name of the Bluetooth BR node, specified as a character vector or a string scalar.

    Data Types: char | string

    Node position in 3-D Cartesian coordinates, specified as a three-element numeric row vector. This value specifies the position of the node in Cartesian x, y, and z coordinates. Units are in meters.

    Data Types: double

    Transmitter antenna gain, specified as a finite numeric scalar. Units are in dB.

    Data Types: double

    Receiver antenna gain, specified as a finite numeric scalar. Units are in dB.

    Data Types: double

    Receiver sensitivity, specified as a finite numeric scalar. This property sets the minimum power that the receiver requires to detect the incoming packet. If the received power of an incoming packet is below this value, the node drops the packet. Units are in dBm.

    Data Types: double

    Noise figure, specified as a nonnegative finite scalar. The object uses this value to apply thermal noise on the received packet. Units are in dB.

    Data Types: double

    Fidelity level to model interference, specified as 0 or 1.

    • If you set this value to 0, the object considers packets overlapping in time and frequency as interference (co-channel interference).

    • If you set this value to 1, the object considers all the packets (in the 2.4GHz ISM band) overlapping in time as interference, irrespective of the frequency overlap.

    Data Types: double

    This property is read-only.

    Node identifier, stored as an integer scalar. This value specifies a unique identifier for the node in the simulation. The object assigns this value incrementally, starting from 1.

    Data Types: double

    This property is read-only.

    Role of the Bluetooth BR node, specified as "central" or "peripheral".

    Data Types: char | string

    Address of the Bluetooth BR node, stored as a 12-element character vector or a string scalar denoting a 6-octet hexadecimal value. This value is unique to each Bluetooth BR node and is derived from the ID property.

    Data Types: char | string

    This property is read-only.

    Bluetooth BR connection configuration parameters, stored as a bluetoothConnectionConfig object.

    This property is read-only.

    Number of Peripheral nodes associated with the Central node, stored as a positive integer scalar.

    Dependencies

    To enable this property, set the Role property to "central".

    Data Types: double

    Object Functions

    expand all

    addTrafficSourceAdd data traffic source to Bluetooth BR node on ACL connection
    statisticsGet statistics of Bluetooth BR node
    updateChannelListUpdate channel list of Bluetooth BR node

    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]
    
    

    Initialize the wireless network simulator.

    networkSimulator = wirelessNetworkSimulator.init();

    Create two Bluetooth BR nodes, one with the "central" role and 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 Bluetooth BR Central and Peripheral nodes.

    cfgConnection = bluetoothConnectionConfig;

    Configure 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);

    Schedule channel list update at the Central node at 0.05 seconds to use channels 0 to 40.

    scheduleAction(networkSimulator,@(varargin) updateChannelList(centralNode, ...
        0:40,DestinationNode=peripheralNode),[],0.05);

    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 application, baseband, and physical layer (PHY) statistics corresponding to the Central and Peripheral nodes.

    centralStats = statistics(centralNode);
    peripheralStats = statistics(peripheralNode);

    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