Main Content

bluetoothFrequencyHop

Bluetooth BR/EDR channel index for frequency hopping

Since R2020b

    Description

    The bluetoothFrequencyHop object creates a Bluetooth® basic rate/enhanced data rate (BR/EDR) channel index for frequency hopping. Use this object to generate the hopping sequence for inquiry, paging, and connection procedures.

    Creation

    Description

    example

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

    example

    freqHop = bluetoothFrequencyHop(Name,Value) sets Properties by using one or more name-value pairs. Enclose each property name in quotes. For example, ('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 value specifies the Bluetooth BR/EDR device address given as an input to the hop selection kernel. This property ignores all the 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 Central

    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'

    • 'Central page response'

    • 'Peripheral 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 that the object adds to the clock bits.

    Dependencies

    To enable this property, set the SequenceType 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 SequenceType property to 'Page' or 'Inquiry'.

    Data Types: double

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

    Dependencies

    To enable this property, set the SequenceType property to 'Peripheral page response', 'Central 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 SequenceType 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.

    freqHop = bluetoothFrequencyHop;

    Specify the frequency hopping sequence type as connection basic.

    freqHop.SequenceType = 'Connection basic';

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

    inputClock = '2C';                 % 28-bit
    freqHop.DeviceAddress = '2A96EF25'
    freqHop = 
      bluetoothFrequencyHop with properties:
    
        DeviceAddress: '2A96EF25'
         SequenceType: 'Connection basic'
    
    

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

    [channelIndex, X] = nextHop(freqHop,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.

    freqHop = bluetoothFrequencyHop('SequenceType','Connection adaptive', ...
        'DeviceAddress','2A96EF25','UsedChannels',22:78)
    freqHop = 
      bluetoothFrequencyHop with properties:
    
        DeviceAddress: '2A96EF25'
         SequenceType: 'Connection adaptive'
         UsedChannels: [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 69 70 71 72 73 74 75 76 77 78]
    
    

    Specify a clock value.

    inputClock = '12C';      % 28-bit

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

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

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

    freqHop = bluetoothFrequencyHop;

    Specify the frequency hopping sequence type as page.

    freqHop.SequenceType = 'Page';

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

    inputClock = 44;               % 28-bit
    freqHop.KOffset = 24;
    freqHop.DeviceAddress = '2A96EF25'
    freqHop = 
      bluetoothFrequencyHop with properties:
    
        DeviceAddress: '2A96EF25'
         SequenceType: 'Page'
               KNudge: 0
              KOffset: 24
    
    

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

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

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

    freqHop = bluetoothFrequencyHop;

    Specify the frequency hopping sequence type as 'Peripheral page response'.

    freqHop.SequenceType = 'Peripheral page response';

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

    frozenClock = '2A';                % 28-bit
    freqHop.Counter = 1;
    freqHop.DeviceAddress = '2A96EF25'
    freqHop = 
      bluetoothFrequencyHop with properties:
    
        DeviceAddress: '2A96EF25'
         SequenceType: 'Peripheral page response'
              Counter: 1
    
    

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

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

    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 R2020b

    See Also

    Objects