Main Content

Create Bluetooth Piconet by Enabling ACL Traffic, SCO Traffic, and AFH

Bluetooth® Toolbox capabilities enable you to create and configure a Bluetooth piconet with basic rate (BR) physical layer (PHY) mode. The toolbox provides functionalities to configure asynchronous connection-oriented (ACL) link, synchronous connection-oriented (SCO) link, or both between the Central and Peripheral. You can also configure the frequency hopping techniques as basic frequency hopping or adaptive frequency hopping (AFH).

Configure the simulation parameters of the Bluetooth piconet by creating a structure. Specify the number of Peripherals in the piconet. A piconet can contain a maximum of seven Peripherals.

simulationParameters = struct;
simulationParameters.NumPeripherals = 2;

Calculate the total number of nodes in the piconet (one Central and multiple Peripherals).

numNodes = simulationParameters.NumPeripherals + 1;

Specify the type of logical link between the Central and Peripherals. Valid logical link values depend on how many Peripherals are connected to the Central.

  • If the Central is connected to one Peripheral, you must specify the logical link value as a one-element vector of 1 (ACL link), 2 (SCO link), or 3 (ACL and SCO links).

  • If the Central is connected to multiple Peripherals, you must specify the logical link value as an n-element row vector, where n is the number of Peripherals. Each element must be 1 (ACL link), 2 (SCO link), or 3 (ACL and SCO links).

To enable an ACL logical transport, set the logical link traffic to 1 or 3. You can specify the ACL packet type as 'DM1', 'DH1', 'DM3', 'DH3', 'DM5', or 'DH5'. To enable an SCO logical transport, set the logical link traffic to 2 or 3. You can specify the SCO packet type as 'HV1', 'HV2', or 'HV3' for the respective Peripheral that has SCO link traffic.

Enable ACL and SCO traffic, specifying the type of ACL and SCO packet as 'DM5' and 'HV3', respectively.

simulationParameters.LinkTraffic = [1 2];
simulationParameters.ACLPacketType = 'DM5';
simulationParameters.SCOPacketType = {2,'HV3'};

To enable AFH, set the sequence type to Connection adaptive.

simulationParameters.SequenceType = 'Connection adaptive';

Initialize a cell array to store the Bluetooth nodes.

btNodes = cell(1,numNodes);

Specify the distance (in meters) between two Bluetooth nodes.

interNodeDistance = 10;

Set the positions of the Bluetooth nodes.

simulationParameters.NodePositions = zeros(numNodes,3);
for nodeIdx = 1:numNodes
    simulationParameters.NodePositions(nodeIdx,:) = [nodeIdx*interNodeDistance 0 0];      % Set node position

Set the node configuration parameters related to the wireless channel and channel classification.

simulationParameters.EbNo = 22;                            % Ratio of energy per bit (Eb) to spectral noise density (No) in dB
simulationParameters.WLANInterference = 'None';
simulationParameters.SIR = [-15 -16 -14 -13 -12 -11 -10];  % Signal to interference ratio in dB
simulationParameters.PERThreshold = 40;                    % Packet error rate
simulationParameters.ClassificationInterval = 3000;        % Classification interval in slots
simulationParameters.RxStatusCount = 10;                   % Status of maximum number of received packets
simulationParameters.MinRxCountToClassify = 4;             % Status of minimum number of received packets for each channel to classify a channel as good or bad
simulationParameters.PreferredMinimumGoodChannels = 20;    % Preferred number of good channels required to communicate between the Central and Peripherals
simulationParameters.TxPower = 20;                         % Transmit power in dBm
simulationParameters.ReceiverRange = 40;                   % Bluetooth node receiver range in meters

Create a Bluetooth piconet by using the helperBluetoothCreatePiconet helper function. This helper function creates a piconet supporting BR PHY mode.



[1] Bluetooth® Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed December 17, 2021.

[2] Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification." Version 5.3.

Related Topics