bluetoothConnectionConfig
Description
Use the bluetoothConnectionConfig
object to set the baseband
connection configuration parameters for a Bluetooth® basic rate/enhanced data rate (BR/EDR) Central and Peripheral node
pair.
Creation
Syntax
Description
creates a default Bluetooth BR/EDR connection configuration object that shares the baseband connection
configuration parameters between a Central and a Peripheral node.cfgConnection
= bluetoothConnectionConfig
sets properties by
using one or more name-value arguments. For example,
cfgConnection
= bluetoothConnectionConfig(Name=Value
)HoppingSequenceType="Connection adaptive"
sets the frequency hopping
sequence type to "Connection adaptive"
.
Properties
CentralToPeripheralACLPacketType
— Packet type used over ACL logical transport from Central to Peripheral
"DH1"
(default) | "DM1"
| "DM3"
| "DH3"
| "DM5"
| "DH5"
| "2-DH1"
| "2-DH3"
| "2-DH5"
| "3-DH1"
| "3-DH3"
| "3-DH5"
Packet type used over the asynchronous connection-oriented logical (ACL) logical
transport from Central to Peripheral node, specified as "DH1"
,
"DM1"
, "DM3"
, "DH3"
,
"DM5"
, "DH5"
, "2-DH1"
,
"2-DH3"
, "2-DH5"
, "3-DH1"
,
"3-DH3"
, or "3-DH5"
.
Data Types: char
| string
PeripheralToCentralACLPacketType
— Packet type used over ACL logical transport from Peripheral to Central
"DH1"
(default) | "DM1"
| "DM3"
| "DH3"
| "DM5"
| "DH5"
| "2-DH1"
| "2-DH3"
| "2-DH5"
| "3-DH1"
| "3-DH3"
| "3-DH5"
Packet type used over ACL logical transport from Peripheral to Central node,
specified as "DH1"
, "DM1"
,
"DM3"
, "DH3"
, "DM5"
,
"DH5"
, "2-DH1"
, "2-DH3"
,
"2-DH5"
, "3-DH1"
, "3-DH3"
, or
"3-DH5"
.
Data Types: char
| string
SCOPacketType
— Packet type used over SCO logical transport between Central and Peripheral
"None"
(default) | "HV1"
| "HV2"
| "HV3"
Packet type transmitted and received over the synchronous connection-oriented (SCO)
logical transport, specified as "None"
, "HV1"
,
"HV2"
, or "HV3"
. If you set this property to
"None"
, the object disables the SCO link, and no voice transmission
occurs between the Bluetooth BR/EDR nodes. If you set this property to
"HV1"
, "HV2"
, or "HV3"
, the
object enables the synchronous link. Based on the configured SCO packet type, the
Bluetooth BR/EDR node internally generates voice traffic with a data rate of 64 Kbps. To
send "DV"
packets over the SCO link, perform these steps.
Set this property to
"HV1"
.Attach an ACL traffic source for the data payload with a packet size in the range of [1, 9] bytes.
The object supports one SCO link in a physical link and up to three SCO links at the Central node.
Data Types: char
| string
HoppingSequenceType
— Frequency hopping sequence type
"Connection basic"
(default) | "Connection adaptive"
Frequency hopping sequence type, specified as "Connection basic"
or "Connection adaptive"
.
Data Types: char
| string
UsedChannels
— List of used (good) data channels
[0:78]
(default) | vector of integers in range [0, 78]
List of used (good) data channels for the Bluetooth BR/EDR physical link to use, specified as a vector of integers in the range [0, 78]. This value specifies the indices of the assigned data channels. 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.
Dependencies
To enable this property, set the HoppingSequenceType property to "Connection
adaptive"
.
Data Types: double
PollInterval
— Maximum interval between two successive poll requests
40
(default) | integer in range [6, 4096]
Maximum interval between two successive poll requests, specified as an integer in the range [6, 4096]. Set this value in number of slots. For more information about this property, see the Bluetooth Core Specification [2], Volume 2, Part C, Section 5.4.
Data Types: double
InstantOffset
— Slots after which new channel map is enforced
240
(default) | integer in range [96, 69120000]
Slots after which the new channel map is enforced, specified as an integer in the
range [96, 69120000]. The object adds this value to the current clock and updates the
channel map. Units are in slots. This value must be at least
6×
PollInterval
slots or 96 slots, whichever is
greater.
Dependencies
To enable this property, set the HoppingSequenceType property to "Connection
adaptive"
.
Data Types: double
TransmitterPower
— Signal transmission power
0
(default) | scalar in range [–20, 20]
Signal transmission power, specified as a scalar in the range [–20, 20]. The transmitter applies this value on the signal before sending it to the antenna. Units are in dBm.
Data Types: double
SupervisionTimeout
— Connection supervision timeout
32000
(default) | scalar in range [400, 65535] | Inf
Connection supervision timeout, specified as a scalar in the range [400, 65535] or
Inf
. Units are in slots.
If the Bluetooth BR/EDR node does not receive a valid packet within the time set by this value, the object times out the connection. After the timeout, the logical link is disconnected at the baseband layer and no connection exists between the nodes.
If you set this value to Inf, the connection is always active.
Data Types: double
CentralAddress
— Bluetooth BR/EDR Central node address
blanks(0)
(default) | 12-element character vector | string scalar denoting 6-octet hexadecimal value
This property is read-only.
Bluetooth BR/EDR Central node address, stored as a 12-element character vector or a string scalar denoting a 6-octet hexadecimal value. This property sets a unique address for the Bluetooth BR/EDR Central node.
Data Types: char
| string
PrimaryLTAddress
— Primary logical transport address
[]
(default) | positive integer scalar
This property is read-only.
Primary logical transport address, stored as a positive integer scalar.
Data Types: double
Note
The physical layer (PHY) transmission mode of the packets specified by the CentralToPeripheralACLPacketType and PeripheralToCentralACLPacketType properties must be the same.
Object Functions
Specific to This Object
configureConnection | Configure connection between Bluetooth BR/EDR Central and Peripheral nodes |
Examples
Create, Configure, and Simulate Bluetooth BR Nodes
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;
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]);
Add a random waypoint mobility model to the peripheral node. Set the shape of the node's mobility area to "circle"
.
addMobility(peripheralNode,BoundaryShape="circle")
Create a default Bluetooth BR/EDR 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 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, ...
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);
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]
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
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)