Main Content

bleLLDataChannelPDU

Generate Bluetooth LE LL data channel PDU

    Description

    example

    dataLLpdu = bleLLDataChannelPDU(cfgLLData) generates a Bluetooth® low energy (LE) link layer (LL) data channel protocol data unit (PDU), dataLLpdu, for a given Bluetooth LE LL data channel configuration object, cfgLLData. Use this syntax to generate a Bluetooth LE LL control PDU.

    example

    dataLLpdu = bleLLDataChannelPDU(cfgLLData,LLPayload) generates a Bluetooth LE LL data channel PDU, dataLLpdu, containing the upper-layer payload LLPayload for a given Bluetooth LE LL data channel configuration object, cfgLLData. Use this syntax to generate a Bluetooth LE LL data PDU.

    Examples

    collapse all

    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 for a control PDU of type 'Connection update indication'.

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

    Generate a Bluetooth LE LL data channel PDU of type 'Connection update indication' by using the configuration object 'cfgLLData'. Display the PDU length in octets.

    dataLLpdu = bleLLDataChannelPDU(cfgLLData);
    numel(dataLLpdu)/8
    ans = 17
    

    Display the first octet of the generated BLE LL data channel PDU.

    dataLLpdu(1:8)
    ans = 8×1
    
         1
         1
         0
         0
         0
         0
         0
         0
    
    

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

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

    Generate a Bluetooth LE LL data PDU by using the corresponding configuration object, 'cgLLData' and the upper-layer payload '030004000A0100'. Display the PDU length in octets.

    dataLLpdu = bleLLDataChannelPDU(cfgLLData,'030004000A0100');
    numel(dataLLpdu)/8
    ans = 12
    

    Display the first octet of the generated BLE LL data PDU.

    dataLLpdu(1:8)
    ans = 8×1
    
         1
         0
         0
         0
         0
         0
         0
         0
    
    

    Input Arguments

    collapse all

    Bluetooth LE LL data channel configuration object, specified as a bleLLDataChannelPDUConfig object.

    Upper-layer payload, specified as one of these types:

    • Character vector — This vector represents octets in hexadecimal format.

    • String scalar — This scalar represents octets in hexadecimal format.

    • Numeric vector of elements in the range [0,255] — This vector represents octets in decimal format.

    • n-by-2 character array — Each row represents an octet in hexadecimal format. n represents total number of rows.

    Data Types: char | string | double

    Output Arguments

    collapse all

    Generated Bluetooth LE LL data channel PDU, returned as a binary column vector.

    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

    Version History

    Introduced in R2019b