Main Content


Update channel list of Bluetooth BR/EDR node

Since R2022b

    Download Required: To use updateChannelList, first download the Communications Toolbox Wireless Network Simulation Library add-on. For more information, see Get and Manage Add-Ons.



    status = updateChannelList(bluetoothBRNodeObj,newUsedChannelsList,DestinationNode=destinationNode) updates the channel map for the physical link between the Bluetooth® basic rate/enhanced data rate (BR/EDR) node, bluetoothBRNodeObj, and the specified destination node, destinationNode. The newUsedChannelsList input specifies a new list of used channels to the Bluetooth BR/EDR node. The object function returns a status, status, indicating whether bluetoothBRNodeObj accepts the new channel list. To enable this syntax, set the Role property of the bluetoothBRNodeObj object to "central".


    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.


    Initialize the wireless network simulator object.

    networkSimulator = wirelessNetworkSimulator.init();

    Create two Bluetooth EDR 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/EDR connection configuration object to configure and share a connection between Bluetooth EDR Central and Peripheral nodes.

    cfgConnection = bluetoothConnectionConfig(CentralToPeripheralACLPacketType="2-DH3",PeripheralToCentralACLPacketType="2-DH5");

    Configure connection between the Central and the Peripheral nodes.

    connection = configureConnection(cfgConnection,centralNode,peripheralNode)
    connection = 
      bluetoothConnectionConfig with properties:
        CentralToPeripheralACLPacketType: "2-DH3"
        PeripheralToCentralACLPacketType: "2-DH5"
                           SCOPacketType: "None"
                     HoppingSequenceType: "Connection adaptive"
                            UsedChannels: [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 ... ] (1x79 double)
                            PollInterval: 40
                           InstantOffset: 240
                        TransmitterPower: 20
                      SupervisionTimeout: 32000
                          CentralAddress: "D091BBE70001"
                        PrimaryLTAddress: 1

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

    traffic = networkTrafficOnOff(DataRate=200,PacketSize=27, ...

    Add application traffic from the Central to the Peripheral node.


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

    scheduleAction(networkSimulator,@(varargin) updateChannelList(centralNode, ...

    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.


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

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

    Input Arguments

    collapse all

    Bluetooth BR/EDR node object, specified as a bluetoothNode object with the Role property set to "central". To enable this input, perform these steps.

    List of good channels, specified as a vector of integers in the range [0, 78]. This input specifies the new list of used channels with which to update the channel map for the specified Bluetooth BR/EDR node. 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.

    Data Types: double

    Name of the destination node, specified as a bluetoothNode object. The destination node specified by this input must be connected to the Bluetooth BR/EDR node specified by the bluetoothBRNodeObj input by using the configureConnection object function.

    Output Arguments

    collapse all

    Flag indicating whether the baseband layer of the specified Bluetooth BR/EDR node accepts the new channel list, returned as a logical 0 (false) or 1 (true).

    Data Types: logical


    [1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed May 22, 2022.

    [2] Bluetooth Core Specifications Working Group. "Bluetooth Core Specification" v5.3.

    Version History

    Introduced in R2022b