Contenu principal

bluetoothLEPeriodicAdvConfig

R2026b

Bluetooth LE periodic advertisements configuration parameters

Since R2024a

    Description

    Use the bluetoothLEPeriodicAdvConfig object to specify the configuration parameters to simulate Bluetooth® low energy (LE) periodic advertisements (PA) between a Broadcaster and an Observer.

    Creation

    Description

    cfgPeriodicAdv = bluetoothLEPeriodicAdvConfig creates a default Bluetooth LE PA configuration object, cfgPeriodicAdv, between a Broadcaster and an Observer.

    cfgPeriodicAdv = bluetoothLEPeriodicAdvConfig(PropertyName=Value) sets properties of the Bluetooth LE PA configuration object by using one or more optional name-value arguments. For example, bluetoothLEPeriodicAdvConfig(PeriodicAdvInterval=0.5) sets the PA interval to 0.5 seconds.

    example

    Properties

    expand all

    Periodic advertising interval, specified as a scalar in the range [0.0075, 81.91875]. Units are in seconds. This property specifies the interval between the start of two consecutive PA events. Set this value as an integer multiple of 1.25 milliseconds. The default value is 0.010 seconds. For more information about PA intervals, see Bluetooth Core Specification v5.3 [2], Vol 6, Part B, Section 4.4.2.2.3.

    Data Types: double

    Offset for starting the PAT, specified as a scalar in the range [0, N]. This equation defines N:

    PeriodicAdvInterval−(MaxPeriodicPDUDuration+T_IFS)

    where:

    • PeriodicAdvInterval — Value of the PeriodicAdvInterval property in seconds.

    • MaxPeriodicPDUDuration — Time required for the Broadcaster node to transmit a packet containing the maximum advertising payload, in seconds.

    • T_IFS — Interframe spacing time, in seconds.

    This property specifies the synchronization packet window offset by considering the reference point as the simulation start time. Units are in seconds. For more information about the synchronization packet window offset, see Bluetooth Core Specification v5.3 [2], Vol 6, Part B, Section 2.3.4.6.

    Data Types: double

    PHY mode for generation or decoding, specified as "LE125K", "LE500K", "LE1M", or "LE2M".

    Data Types: char | string

    List of used (good) data channels, specified as a vector of integers. Each element in the vector must be a unique value in the range [0, 36]. This property specifies the indices of the assigned good data channels that the PAT uses. To ensure you set at least two channels as used (good) channels, specify a vector with a length greater than 1.

    Data Types: double

    Since R2026b

    Type of periodic advertising train, specified as one of these options.

    • "PADVB" — Periodic advertising train without responses (PADVB)

    • "PAwR" — Periodic advertising train with responses (PAwR)

    Since R2026b

    Number of subevents in the periodic advertising event, specified as an integer in the range [1, 128]. This property specifies the number of subevents in each periodic advertising event.

    Dependencies

    To enable this property, set the value of PeriodicAdvType property to "PAwR".

    Data Types: double

    Since R2026b

    Subevent interval, specified as a scalar in the range [0.0075, 0.31875]. Units are in seconds. This property specifies the time between the start of two consecutive subevents in a periodic advertising train with responses. Set this value as an integer multiple of 1.25 milliseconds. This value must account for the time required to transmit the broadcaster packet and receive the observer(s) responses.

    Dependencies

    To enable this property, set the value of PeriodicAdvType property to "PAwR".

    Data Types: double

    Since R2026b

    Number of response slots, specified as an integer in the range [0, 255]. This property specifies the number of response slots in each subevent of the periodic advertising train with responses. Setting the value to 0 results in the absence of responses.

    Dependencies

    To enable this property, set the value of PeriodicAdvType property to "PAwR".

    Data Types: double

    Since R2026b

    Response slot delay, specified as a scalar in the range [0.00125, 0.3175]. Units are in seconds. This property specifies the time between the start of the subevent to the first response slot. Set this value as an integer multiple of 1.25 milliseconds. This value must account for the maximum amount of time needed for processing on the receiver nodes and to prepare the responses.

    Dependencies

    To enable this property, set the value of PeriodicAdvType property to "PAwR".

    Data Types: double

    Since R2026b

    Response slot spacing, specified as a scalar in the range [0.00025, 0.031875]. Units are in seconds. This property specifies the time between the start of two consecutive response slots in the subevent of a periodic advertising train with responses. Set this value as an integer multiple of 0.125 milliseconds.

    Dependencies

    To enable this property, set the value of PeriodicAdvType property to "PAwR".

    Data Types: double

    This property is read-only.

    Access address, represented as an 8-element character vector or a string scalar denoting a 4-octet hexadecimal value. This property value provides a unique 32-bit address for the link layer periodic advertising train transmissions between broadcaster and observer node(s).

    Data Types: char | string

    Since R2026b

    This property is read-only.

    Response access address, represented as an 8-element character vector or a string scalar denoting a 4-octet hexadecimal value. This property value provides a unique 32-bit address for the link layer periodic advertising train transmissions between observer node(s) and broadcaster.

    Dependencies

    To enable this property, set the value of PeriodicAdvType property to "PAwR".

    Data Types: char | string

    Object Functions

    configurePeriodicAdvConfigure Bluetooth LE periodic advertisements between Broadcaster and Observer

    Examples

    collapse all

    This example enables you to:

    1. Create and configure a Bluetooth LE piconet with Broadcaster and Observer nodes.

    2. Create and Configure a PAT between the Broadcaster and Observer nodes.

    3. Configure and add application traffic at the Broadcaster node.

    4. Simulate the Bluetooth LE piconet and retrieve the statistics of the Broadcaster and Observer nodes.

    Create a wireless network simulator.

    networkSimulator = wirelessNetworkSimulator.init;

    Create a Bluetooth LE node, specifying the role as "broadcaster". Specify the name and position of the node.

    broadcasterNode = bluetoothLENode("broadcaster",Name="Broadcaster");
    broadcasterNode.Position = [0 0 0];                % In x-, y-, and z-coordinates, in meters

    Create two Bluetooth LE nodes, specifying their roles as "observer". Specify the names and positions of the nodes.

    observerNode1 = bluetoothLENode("observer",Name="Observer1");
    observerNode1.Position = [5 5 0];                             % x-, y-, and z-coordinates, in meters
    observerNode2 = bluetoothLENode("observer",Name="Observer2"); 
    observerNode2.Position = [10 0 10];                           % x-, y-, and z-coordinates, in meters

    Create a PAT between the Broadcaster and Observer nodes by using the Bluetooth LE periodic advertisements configuration object.

    cfgPeriodicAdv = bluetoothLEPeriodicAdvConfig(PeriodicAdvInterval=60, ...
                                                      UsedChannels=10:30, ...
                                                      PHYMode="LE2M");

    Configure the PAT between the Broadcaster and Observer nodes.

    cfgPeriodicAdvUpdated = configurePeriodicAdv(cfgPeriodicAdv,broadcasterNode,[observerNode1 observerNode2])
    cfgPeriodicAdvUpdated = 
      bluetoothLEPeriodicAdvConfig with properties:
    
        PeriodicAdvInterval: 60
          PeriodicAdvOffset: 0
                    PHYMode: "LE2M"
               UsedChannels: [10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30]
            PeriodicAdvType: "PADVB"
              AccessAddress: 'D9DA7BEA'
    
    

    Create a networkTrafficOnOff (Wireless Network Toolbox) object to generate an On-Off application traffic pattern. Specify the data rate in kb/s and the packet size in bytes. Add application traffic at the Broadcaster node.

    traffic = networkTrafficOnOff(DataRate=1,PacketSize=15,OnTime=Inf,OffTime=0);
    addTrafficSource(broadcasterNode,traffic)

    Add the Broadcaster and Observer nodes to the wireless network simulator.

    addNodes(networkSimulator,[broadcasterNode observerNode1 observerNode2])

    Set the simulation time in seconds, and run the simulation.

    simulationTime = 600;
    run(networkSimulator,simulationTime)

    Retrieve statistics corresponding to the Broadcaster and Observer nodes. For more information about the statistics, see Bluetooth LE Node Statistics.

    broadcasterNodeStats = statistics(broadcasterNode);
    observerNode1Stats = statistics(observerNode1);
    observerNode2Stats = statistics(observerNode2);

    References

    [1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed January 10, 2026. https://www.bluetooth.com/.

    [2] Bluetooth Core Specifications Working Group. "Bluetooth Core Specification" v6.1. https://www.bluetooth.com/.

    Version History

    Introduced in R2024a

    expand all