Main Content

bleLLDataChannelPDUConfig

Bluetooth LE LL data channel PDU configuration parameters

    Description

    The bleLLDataChannelPDUConfig object parameterizes the bleLLDataChannelPDU function to generate a Bluetooth® low energy (LE) link layer (LL) data channel protocol data unit (PDU).

    Creation

    Description

    cfgLLData = bleLLDataChannelPDUConfig creates a default Bluetooth LE LL data channel PDU configuration object, cfgLLData.

    example

    cfgLLData = bleLLDataChannelPDUConfig(Name,Value) sets properties by using one or more name-value pairs. Enclose each property name in quotes. For example, ('LLID','Data (start fragment/complete)') sets the type of Bluetooth LE LL data channel PDU as a data PDU.

    example

    Properties

    expand all

    Note

    For more information about Bluetooth LE LL data channel PDU properties and their respective values, see Volume 6, Part B, Section 2.4 of the Bluetooth Core Specification [2].

    Link layer identifier, specified as a character vector or a string scalar to describe the type of a Bluetooth LE LL data channel PDU. Specify this property as one of these values:

    • 'Data (continuation fragment/empty)'

    • 'Data (start fragment/complete)'

    • 'Control'

    Data Types: char | string

    Next expected sequence number, specified as 1 (true) or 0 (false). This property indicates either an acknowledgment for the last received packet or a request for resending the last transmitted packet from the peer.

    Data Types: logical

    Transmitting packet sequence number, specified as 1 (true) or 0 (false). This property indicates the sequence number of the transmitted packet.

    Data Types: logical

    Indication for more data, specified as 1 (true) or 0 (false). A 1 (true) value indicates that the sender has more data to send.

    Data Types: logical

    CRC initialization value, specified as a 6-element character vector or a string scalar denoting a 3-octet hexadecimal value.

    Data Types: char | string

    Bluetooth LE LL control PDU payload configuration object, specified as a bleLLControlPDUConfig object. The object configures the fields of this value by using the properties of bleLLControlPDUConfig object. The object uses this property to generate and decode a Bluetooth LE LL control PDU.

    Examples

    collapse all

    Create a default Bluetooth LE LL data channel PDU configuration object for a data PDU.

    cfgLLData = bleLLDataChannelPDUConfig
    cfgLLData = 
      bleLLDataChannelPDUConfig with properties:
    
                     LLID: 'Data (continuation fragment/empty)'
                     NESN: 0
           SequenceNumber: 0
                 MoreData: 0
        CRCInitialization: '012345'
    
    

    Set the value of LLID to 'Data (start fragment/complete)'.

    cfgLLData.LLID = 'Data (start fragment/complete)'
    cfgLLData = 
      bleLLDataChannelPDUConfig with properties:
    
                     LLID: 'Data (start fragment/complete)'
                     NESN: 0
           SequenceNumber: 0
                 MoreData: 0
        CRCInitialization: '012345'
    
    

    Create two unique Bluetooth LE LL data channel PDU configuration objects for a control PDU of type 'Channel map indication' and 'Version indication'.

    Create a Bluetooth LE LL control PDU payload configuration object for a control PDU with opcode 'Channel map indication'.

    cfgControl = bleLLControlPDUConfig('Opcode','Channel map indication')
    cfgControl = 
      bleLLControlPDUConfig with properties:
    
              Opcode: 'Channel map indication'
             Instant: 0
        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]
    
    

    Create a Bluetooth LE LL data channel configuration object by specifying the values of 'LLID' as 'Control' and 'ControlConfig' as 'cfgControl'.

     cfgLLData = bleLLDataChannelPDUConfig('LLID','Control', ...
        'ControlConfig',cfgControl)
    cfgLLData = 
      bleLLDataChannelPDUConfig with properties:
    
                     LLID: 'Control'
                     NESN: 0
           SequenceNumber: 0
                 MoreData: 0
        CRCInitialization: '012345'
            ControlConfig: [1x1 bleLLControlPDUConfig]
    
    

    Create another Bluetooth LE LL data channel configuration object for a control PDU, this time specifying the opcode as 'Version indication'.

    cfgControl.Opcode = 'Version indication';
    cfgControl.SubVersionNumber = '008E'
    cfgControl = 
      bleLLControlPDUConfig with properties:
    
                   Opcode: 'Version indication'
            VersionNumber: '5.0'
        CompanyIdentifier: 'FFFF'
         SubVersionNumber: '008E'
    
    

    Create a Bluetooth LE LL data channel configuration object, specifying the values of 'ControlConfig' as 'cfgControl'.

    cfgLLData.ControlConfig = cfgControl
    cfgLLData = 
      bleLLDataChannelPDUConfig with properties:
    
                     LLID: 'Control'
                     NESN: 0
           SequenceNumber: 0
                 MoreData: 0
        CRCInitialization: '012345'
            ControlConfig: [1x1 bleLLControlPDUConfig]
    
    

    Create a default Bluetooth LE LL data channel PDU configuration object for a data PDU.

    cfgLLData = bleLLDataChannelPDUConfig
    cfgLLData = 
      bleLLDataChannelPDUConfig with properties:
    
                     LLID: 'Data (continuation fragment/empty)'
                     NESN: 0
           SequenceNumber: 0
                 MoreData: 0
        CRCInitialization: '012345'
    
    

    Initialize the CRC value.

    cfgLLData.CRCInitialization = '123456';

    Generate a Bluetooth LE LL data channel PDU by using the upper-layer payload, '030004000A0100'.

    pdu = bleLLDataChannelPDU(cfgLLData,'030004000A0100');

    Decode the generated Bluetooth LE LL data channel PDU by initializing the CRC value. The returned status indicates decoding is successful.

    crcInit = '123456';
    [status,cfgRx,llPayload] = bleLLDataChannelPDUDecode(pdu,crcInit)
    status = 
      blePacketDecodeStatus enumeration
    
        Success
    
    
    cfgRx = 
      bleLLDataChannelPDUConfig with properties:
    
                     LLID: 'Data (continuation fragment/empty)'
                     NESN: 0
           SequenceNumber: 0
                 MoreData: 0
        CRCInitialization: '123456'
    
    
    llPayload = 7x2 char array
        '03'
        '00'
        '04'
        '00'
        '0A'
        '01'
        '00'
    
    

    References

    [1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 22, 2021. 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