bluetoothFrequencyHop

Bluetooth BR/EDR channel index for frequency hopping

    Download Required: To use bluetoothFrequencyHop, first download Communications Toolbox™ Library for the Bluetooth® Protocol. For more information, see Get and Manage Add-Ons. Alternatively, see Communications Toolbox Library for the Bluetooth Protocol File Exchange.

    Description

    The bluetoothFrequencyHop object creates a Bluetooth basic rate/enhanced data rate (BR/EDR) channel index for frequency hopping. This object generates the hopping sequence used in inquiry, paging, and connection procedures.

    Creation

    Description

    example

    FH = bluetoothFrequencyHop creates a default Bluetooth BR/EDR channel index object for frequency hopping.

    example

    FH = bluetoothFrequencyHop(Name,Value) sets Properties by using one or more name-value pairs. Enclose each property name in quotes. For example, bluetoothFrequencyHop('SequenceType','Page') sets the frequency hopping sequence type to Page.

    Properties

    expand all

    Bluetooth BR/EDR device address, specified as a 12-element character vector or a string scalar denoting a 6-octet hexadecimal value. This property indicates the Bluetooth BR/EDR device address given as an input to the hop selection kernel. This property ignores all consecutive 0s starting from the most significant bit (MSB). This table maps the value of this property to different physical channels.

    Type of Physical Channel Value of DeviceAddress Property
    Basic

    Address of Master

    Page scan

    Address of the scanning device

    Inquiry

    General inquiry access code (GIAC)

    The default value of this property denotes the lower address part (LAP) of GIAC.

    Data Types: char | string

    Frequency hopping sequence type, specified as one of these values:

    • 'Page scan'

    • 'Inquiry scan'

    • 'Page'

    • 'Inquiry'

    • 'Master page response'

    • 'Slave page response'

    • 'Inquiry response'

    • 'Connection basic'

    • 'Connection adaptive'

    • 'Interlaced page scan'

    • 'Interlaced inquiry scan'

    Data Types: char | string

    Offset for available frequencies in inquiry and paging procedures, specified as an integer in the range [0, 31].

    Dependencies

    To enable this property, set the SequenceType property to 'Interlaced page scan' or 'Interlaced inquiry scan'.

    Data Types: double

    Offset to compute control signal (X), specified as an even integer. This property specifies the additional offset added to the clock bits.

    Dependencies

    To enable this property, set the SequencyType property to 'Page' or 'Inquiry'.

    Data Types: double

    Offset to switch between A-train and B-train, specified as 24 (for A-train) or 8 (for B-train). To switch between the trains, this property specifies the offset added to the clock bits.

    Dependencies

    To enable this property, set the SequencyType property to 'Page' or 'Inquiry'.

    Data Types: double

    Counter for Master or Slave page response sequence, specified as a nonnegative integer. This property is incremented at every Master transmission slot.

    Dependencies

    To enable this property, set the SequencyType property to 'Slave page response', 'Master page response', or 'Inquiry response'.

    Data Types: double

    List of used channels, specified as a vector of integers in the range [0, 78]. The vector must contain at least 20 elements.

    Dependencies

    To enable this property, set the SequencyType property to 'Connection adaptive'.

    Data Types: double

    Object Functions

    expand all

    nextHopSelect Bluetooth BR/EDR channel index to hop for next frequency

    Examples

    collapse all

    Create a Bluetooth BR/EDR channel index object for frequency hopping.

    fh = bluetoothFrequencyHop;

    Specify the frequency hopping sequence type as connection basic.

    fh.SequenceType = 'Connection basic';

    Specify a clock value and Bluetooth BR/EDR device address.

    inputClock = '2C'; % 28-bit
    fh.DeviceAddress = '2A96EF25'
    fh = 
      bluetoothFrequencyHop with properties:
    
          DeviceAddress: '2A96EF25'
           SequenceType: 'Connection basic'
        InterlaceOffset: 16
                 KNudge: 0
                KOffset: 24
                Counter: 0
           UsedChannels: [1x79 double]
    
    

    Select a Bluetooth BR/EDR channel index to hop for next frequency.

    [channelIndex, X] = nextHop(fh,inputClock)
    channelIndex = 27
    
    X = 11
    

    Create a Bluetooth BR/EDR channel index object for frequency hopping, specifying frequency hopping sequence type, Bluetooth BR/EDR device address, and used channels.

    fh = bluetoothFrequencyHop('SequenceType','Connection adaptive', ...
        'DeviceAddress','2A96EF25','UsedChannels',22:78)
    fh = 
      bluetoothFrequencyHop with properties:
    
          DeviceAddress: '2A96EF25'
           SequenceType: 'Connection adaptive'
        InterlaceOffset: 16
                 KNudge: 0
                KOffset: 24
                Counter: 0
           UsedChannels: [1x57 double]
    
    

    Specify a clock value.

    inputClock = '12C'; % 28-bit

    Select a Bluetooth BR/EDR channel index to hop for next frequency.

    [channelIndex, X] = nextHop(fh, inputClock)
    channelIndex = 65
    
    X = 11
    

    Create a Bluetooth BR/EDR channel index object for frequency hopping.

    fh = bluetoothFrequencyHop;

    Specify the frequency hopping sequence type as page.

    fh.SequenceType = 'Page';

    Specify a clock value, offset to select frequencies in A-train, and Bluetooth BR/EDR device address.

    inputClock = 44; % 28-bit
    fh.KOffset = 24;
    fh.DeviceAddress = '2A96EF25'
    fh = 
      bluetoothFrequencyHop with properties:
    
          DeviceAddress: '2A96EF25'
           SequenceType: 'Page'
        InterlaceOffset: 16
                 KNudge: 0
                KOffset: 24
                Counter: 0
           UsedChannels: [1x79 double]
    
    

    Select a Bluetooth BR/EDR channel index to hop for next frequency.

    [channelIndex, X] = nextHop(fh, inputClock)
    channelIndex = 15
    
    X = 30
    

    Create a Bluetooth BR/EDR channel index object for frequency hopping.

    fh = bluetoothFrequencyHop;

    Specify the frequency hopping sequence type as Slave page response.

    fh.SequenceType = 'Slave page response';

    Specify a clock value, counter for Slave page response, and Bluetooth BR/EDR device address.

    frozenClock = '2A'; % 28-bit
    fh.Counter = 1;
    fh.DeviceAddress = '2A96EF25'
    fh = 
      bluetoothFrequencyHop with properties:
    
          DeviceAddress: '2A96EF25'
           SequenceType: 'Slave page response'
        InterlaceOffset: 16
                 KNudge: 0
                KOffset: 24
                Counter: 1
           UsedChannels: [1x79 double]
    
    

    Select a Bluetooth BR/EDR channel index to hop for next frequency.

    [channelIndex, X] = nextHop(fh, frozenClock)
    channelIndex = 28
    
    X = 1
    

    References

    [1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 22, 2019. https://www.bluetooth.com/.

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

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Introduced in R2020b