Main Content

configureScheduler

Configure baseband scheduler at Bluetooth BR/EDR Central node

Since R2023a

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

    Description

    configureScheduler(bluetoothNodeObj) configures the baseband to use the default scheduler at the Bluetooth® basic rate/enhanced data rate (BR/EDR) Central node, bluetoothNodeObj. If a Peripheral node has data to transmit to the Central node, and the available asynchronous connection-oriented (ACL) slots are sufficient for the scheduled transmission, the scheduler selects the corresponding Peripheral node. Otherwise, the scheduler selects the next Peripheral node in a fixed cyclic order. The scheduler does not select any Peripheral node in either of these conditions.

    • If there is data to be communicated between the Central and the Peripheral nodes, but the available ACL slots are insufficient for the communication.

    • If sufficient ACL slots are available for the communication, but there is no data to be communicated between the Central and the Peripheral nodes.

    example

    configureScheduler(bluetoothNodeObj,MaxTransmissions=maxTransmissions) additionally configures the round-robin (RR) scheduler at the Central node based on the maximum number of consecutive transmissions between the Central and the Peripheral node, MaxTransmissions.

    Note

    Note that configuring the baseband scheduler is not mandatory. The default scheduler is preconfigured.

    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 wireless network simulator object.

    networkSimulator = wirelessNetworkSimulator.init;

    Create a Bluetooth BR/EDR Central node and two Peripheral nodes.

    centralNode = bluetoothNode("central");
    peripheralNode1 = bluetoothNode("peripheral",Position=[1 0 0]);
    peripheralNode2 = bluetoothNode("peripheral",Position=[2 0 0]);

    Create two default Bluetooth BR/EDR configuration objects.

    cfgConnection1 = bluetoothConnectionConfig;
    cfgConnection2 = bluetoothConnectionConfig;

    Configure and share connections between the Central node and the Peripheral nodes.

    configureConnection(cfgConnection1,centralNode,peripheralNode1);
    configureConnection(cfgConnection2,centralNode,peripheralNode2);

    Configure an RR scheduler at the Central node by specifying the maximum number of consecutive transmissions as 3.

    configureScheduler(centralNode,MaxTransmissions=3)

    Create and configure a networkTrafficOnOff object to generate an On-Off application traffic pattern between the Central and Peripheral nodes. This object enables you to accurately model the real-world data traffic in a system-level simulation.

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

    Add application traffic from the Central to the Peripheral nodes.

    addTrafficSource(centralNode,traffic1,DestinationNode=peripheralNode1)
    addTrafficSource(centralNode,traffic2,DestinationNode=peripheralNode2)

    Add the nodes to the network simulator

    addNodes(networkSimulator,[centralNode peripheralNode1 peripheralNode2])

    Set the simulation time, in seconds, and run the simulation.

    run(networkSimulator,0.3)

    Retrieve statistics corresponding to the Central and Peripheral nodes.

    centralStats = statistics(centralNode);
    peripheralStats1 = statistics(peripheralNode1);
    peripheralStats2 = statistics(peripheralNode2);

    Input Arguments

    collapse all

    Bluetooth BR/EDR node object, specified as a bluetoothNode object or a vector of bluetoothNode objects. To configure the baseband scheduler, set the Role property of the bluetoothNode object to "central". This input configures the same scheduler at multiple Peripheral nodes. If you specify this input as a vector of bluetoothNode objects, this object function configures the scheduler at all the Central nodes.

    Maximum number of consecutive transmissions scheduled from the Central to the Peripheral node, specified as a positive integer or Inf.

    • If you set this input to 1, the scheduler at the Central node selects each Peripheral node once, in a fixed cyclic order. The scheduler schedules consecutive transmission and reception from the Central node to each Peripheral node, regardless of the availability of the data between the nodes. The first transmission occurs from the Central node to the Peripheral node and the second transmission takes place from the Peripheral node to the Central node.

    • If you set this input to N, where N is an integer in the range (1, Inf), the scheduler at the Central node selects each Peripheral node for a maximum of N times (if data is available) in a fixed cyclic order. If there is no data to be communicated from the Central to the Peripheral node, the scheduler selects the next Peripheral node.

    • If you set this input to Inf, the scheduler at the Central node selects each Peripheral node in an exhaustive cyclic order. If there is data to be communicated between the Central-Peripheral node pair, the scheduler selects the same Peripheral node. If there is no data to be communicated between the Central-Peripheral node pair, the scheduler selects the next Peripheral node.

    Data Types: double

    References

    [1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed October 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 R2023a