Main Content

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

Communications Toolbox™ Library for the Bluetooth® Protocol features enable you to create and configure a Bluetooth piconet. The library provides functionalities to configure asynchronous connection-oriented (ACL) link, synchronous connection-oriented (SCO) link, or both between the Master and the Slave. You can also configure the frequency hopping techniques as basic frequency hopping or adaptive frequency hopping (AFH).

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

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

simulationParameters = struct;
simulationParameters.NumSlaves = 2;

Calculate the total number of nodes in the piconet (one Master and multiple Slaves).

numNodes = simulationParameters.NumSlaves + 1;

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

  • If the Master is connected to one Slave, 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 Master is connected to multiple Slaves, you must specify the logical link value as an n-element row vector, where n is the number of Slaves. 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 Slave that has SCO link traffic.

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

simulationParameters.LinkTraffic = [1 2];
simulationParameters.ACLPacketType = 'DM1';
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
end

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 Master and Slaves
simulationParameters.TxPower = 20;                         % Transmit power in dBm
simulationParameters.ReceiverRange = 40;                   % Bluetooth node receiver range in meters

Create a Bluetooth piconet by using the helperBluetoothCreatePiconet function.

helperBluetoothCreatePiconet(simulationParameters);

References

[1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed September 17, 2020. https://www.bluetooth.com/.

[2] Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification." Version 5.2. https://www.bluetooth.com/.

Related Topics