bleLLControlPDUConfig
Bluetooth LE LL control PDU payload configuration parameters
Description
The bleLLControlPDUConfig
object parameterizes the bleLLDataChannelPDU
function to generate a Bluetooth® low energy (LE) link layer (LL) control protocol data unit (PDU)
payload.
Creation
Description
creates a
default Bluetooth LE LL control PDU payload configuration object.cfgControl
= bleLLControlPDUConfig
sets
properties by
using one or more name-value pairs. Enclose each property name in quotes. For example,
cfgControl
= bleLLControlPDUConfig(Name,Value
)('Opcode','Version indication')
sets the operation code as
'Version indication'
.
Properties
Note
For more information about Bluetooth LE LL control PDU properties and their respective values, see Volume 6, Part B, Section 2.4 of the Bluetooth Core Specification [2].
Opcode
— Bluetooth LE LL control PDU payload configuration operation code
'Connection update indication'
(default) | 'Channel map indication'
| 'Terminate indication'
| 'Unknown response'
| 'Version indication'
| 'Reject indication'
Bluetooth LE LL control PDU payload configuration operation code, specified as one of these values.
'Connection update indication'
'Channel map indication'
'Terminate indication'
'Unknown response'
'Version indication'
'Reject indication'
Data Types: char
| string
WindowSize
— Transmit window size
1
(default) | nonnegative integer in the range [1, Mws]
Transmit window size, specified as a nonnegative integer in the range [1,
Mws], where Mws is the lesser of 8 and
(ConnectionInterval-1). This property indicates the window size within
which the Central transmits a data packet and the Peripheral listens for a data packet
after the connection is established. Each unit is taken as 1.25 ms so that the window
size (WindowSize×1.25) is in the range [1.25, min(10,
((ConnectionInterval
×1.25) - 1.25))] ms.
Data Types: double
ConnectionInterval
— Connection interval
6 (7.5 ms)
(default) | integer in the range [6, 3200]
Connection interval, specified as an integer in the range [6, 3200]. This property
indicates the interval between the start of two consecutive connection events. Each unit
is taken as 1.25 ms so that the connection interval
(ConnectionInterval
×1.25) is in the range of [7.5 ms, 4.0
s].
Data Types: double
PeripheralLatency
— Peripheral latency
0
(default) | nonnegative integer in the range [0, Msl]
Peripheral latency, specified as a nonnegative integer in the range [0,
Msl], where Msl is the lesser of 499 and
((ConnectionTimeout
×10)/((ConnectionInterval
×1.25)×2))-1.
This property indicates the number of connection events that a Peripheral can
ignore.
Data Types: double
ConnectionTimeout
— Connection supervision timeout
10
(default) | nonnegative integer in the range [Mct, 3200]
Connection supervision timeout, specified as a nonnegative integer in the range
[Mct, 3200], where Mct is the larger of 10 and
((1+PeripheralLatency)*(ConnectionInterval
×1.25)×2)/10.
If the Peripheral does not receive a valid packet within this time, this property
indicates the connection timeout. Each unit is taken as 10 ms so that the connection
timeout (ConnectionInterval
×10) is in the range [100 ms, 32.0
s].
Data Types: double
Instant
— Connection event instant
0
(default) | integer in the range [0, 65535]
Connection event instant, specified as an integer in the range [0, 65535]. This property indicates the event count at which specific action must occur.
Data Types: double
UsedChannels
— List of used data channels
row vector containing the channel indices between [0:36] (default) | integer vector with element values in the range [0, 36]
List of used data channels, specified as an integer vector with element values in the range [0, 36]. The vector length must be greater than 1. At least two channels must be set as used (good) channels. This property indicates the set of good channels that the Central classifies.
Data Types: double
ErrorCode
— Connection termination error code
'Success'
(default) | 'Unknown connection identifier'
| 'Hardware failure'
| ...
Connection termination error code, specified as one of these values. Each valid value describes the error description informing the remote device why the connection is about to be terminated.
'Success'
'Unknown connection identifier'
'Hardware failure'
'Memory capacity exceeded'
'Connection timeout'
'Connection limit exceeded'
'Connection already exists'
'Command disallowed'
'Connection accept timeout exceeded'
'Connection rejected due to limited resources'
'Invalid LL parameters'
'Connection rejected due to unacceptable BD_ADDR'
'Unspecified error'
'Unsupported LL parameter value'
'Role change not allowed'
'LL response timeout'
'LL procedure collision'
'Instant passed'
'Channel classification not supported'
'Extended inquiry response too large'
'Connection rejected due to no suitable channel found'
'Advertising timeout'
'Controller busy'
'Unacceptable connection parameters'
'Connection failed to be established'
'Unknown advertising identifier'
'Limit reached'
'Operation cancelled by host'
Data Types: char
| string
UnknownOpcode
— Unrecognized or unsupported operation code
'00'
(default) | 2-element character vector | string scalar denoting 1-octet hexadecimal value
Unrecognized or unsupported operation code, specified as a 2-element character vector or string scalar denoting a 1-octet hexadecimal value. This property indicates the type of Bluetooth LE LL control PDU that the object does not recognize or support.
Data Types: char
| string
VersionNumber
— Version number of Bluetooth Core Specification
'5.0'
(default) | '4.0'
| '4.1'
| '4.2'
Version number of Bluetooth Core Specification, specified as
'4.0'
, '4.1'
, '4.2'
, or
'5.0'
. This property indicates the version number of the Bluetooth
Core Specification.
Data Types: string
CompanyIdentifier
— Manufacturer ID of Bluetooth controller
'FFFF'
(default) | 4-element character vector | string scalar denoting a 2-octet hexadecimal value
Manufacturer ID of Bluetooth controller, specified as a 4-element character vector or a string scalar denoting a 2-octet hexadecimal value. This property indicates the unique identifier assigned to your organization by Bluetooth Special Interest Group (SIG) [2].
Data Types: char
| string
SubVersionNumber
— Subversion number of the Bluetooth controller
'0000'
(default) | 4-element character vector | string scalar denoting a 2-octet hexadecimal value
Subversion number of the Bluetooth controller, specified as a 4-element character vector or string scalar denoting a 2-octet hexadecimal value. This property indicates the unique value for each implementation or revision of a Bluetooth controller implementation.
Data Types: char
| string
Examples
Create Bluetooth LE LL Control PDU Configuration Object
Create a default Bluetooth LE LL control PDU configuration object.
cfgControl = bleLLControlPDUConfig
cfgControl = bleLLControlPDUConfig with properties: Opcode: 'Connection update indication' WindowSize: 1 WindowOffset: 0 ConnectionInterval: 6 PeripheralLatency: 0 ConnectionTimeout: 10 Instant: 0
Set the value of the connection interval to 64
.
cfgControl.ConnectionInterval = 64
cfgControl = bleLLControlPDUConfig with properties: Opcode: 'Connection update indication' WindowSize: 1 WindowOffset: 0 ConnectionInterval: 64 PeripheralLatency: 0 ConnectionTimeout: 10 Instant: 0
Create Bluetooth LE LL Control PDU Configuration Object Using Name-Value Arguments
Create two unique Bluetooth LE LL control PDU configuration objects using name-value arguments: first one of the type 'Terminate indication'
and error code 'Connection timeout'
and second one of the type 'Channel map indication'
with used set of data channels.
Create a Bluetooth LE LL control PDU configuration object, specifying opcode as 'Terminate indication'
and error code as 'Connection timeout'
.
cfgControl = bleLLControlPDUConfig('Opcode','Terminate indication', ... 'ErrorCode','Connection Timeout')
cfgControl = bleLLControlPDUConfig with properties: Opcode: 'Terminate indication' ErrorCode: 'Connection timeout'
Create another Bluetooth LE LL control PDU payload configuration object, this time by setting the value of opcode as 'Channel map indication'
. Specify the list of used data channels.
cfgControl = bleLLControlPDUConfig('Opcode','Channel map indication'); cfgControl.UsedChannels = [0 3 12 16 18 24]
cfgControl = bleLLControlPDUConfig with properties: Opcode: 'Channel map indication' Instant: 0 UsedChannels: [0 3 12 16 18 24]
Create a Bluetooth LE LL data channel configuration object, specifying the values of 'LLID'
as 'Control'
and 'ControlConfig'
as 'cfgControl'
.
cfgLLData = bleLLDataChannelPDUConfig('LLID','Control'); cfgLLData.ControlConfig = cfgControl
cfgLLData = bleLLDataChannelPDUConfig with properties: LLID: 'Control' NESN: 0 SequenceNumber: 0 MoreData: 0 CRCInitialization: '012345' ControlConfig: [1x1 bleLLControlPDUConfig]
End-to-End Workflow of Bluetooth LE LL Control PDU
Create a default Bluetooth LE LL control PDU configuration object.
cfgControl = bleLLControlPDUConfig
cfgControl = bleLLControlPDUConfig with properties: Opcode: 'Connection update indication' WindowSize: 1 WindowOffset: 0 ConnectionInterval: 6 PeripheralLatency: 0 ConnectionTimeout: 10 Instant: 0
Create a Bluetooth LE LL data channel PDU configuration object, specifying the link layer identifier, 'LLID'
, as 'Control'
and 'ControlConfig'
as 'cfgControl'
. Specify the cyclic redundancy check (CRC).
cfgLLData = bleLLDataChannelPDUConfig('LLID','Control', ... 'ControlConfig',cfgControl); cfgLLData.CRCInitialization = 'E23456'
cfgLLData = bleLLDataChannelPDUConfig with properties: LLID: 'Control' NESN: 0 SequenceNumber: 0 MoreData: 0 CRCInitialization: 'E23456' ControlConfig: [1x1 bleLLControlPDUConfig]
Generate a Bluetooth LE LL control PDU.
pdu = bleLLDataChannelPDU(cfgLLData);
Decode the generated Bluetooth LE LL control PDU by initializing the CRC value. The returned status indicates decoding is successful.
crcInit = 'E23456'; % Received during associaton [status,cfgRx,llPayload] = bleLLDataChannelPDUDecode(pdu,crcInit)
status = blePacketDecodeStatus enumeration Success
cfgRx = bleLLDataChannelPDUConfig with properties: LLID: 'Control' NESN: 0 SequenceNumber: 0 MoreData: 0 CRCInitialization: 'E23456' ControlConfig: [1x1 bleLLControlPDUConfig]
llPayload = 1x0 empty char array
References
[1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 22, 2023. https://www.bluetooth.com/.
[2] Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification." Version 5.3. https://www.bluetooth.com/.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2019b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)