Main Content


(Removed) Push data from channel to reception buffer

Since R2022a

    pushChannelData has been removed. To push data from the channel to the reception buffer of the Bluetooth LE node, use the wirelessNetworkSimulator object, instead.



    pushChannelData(bluetoothLENodeObj,packet) pushes the packet packet from the channel to the reception buffer of the Bluetooth® low energy (LE) node specified by the bluetoothLENodeObj object.


    collapse all

    Check if the Communications Toolbox™ Wireless Network Simulation Library support package is installed. If the support package is not installed, MATLAB® returns an error with a link to download and install the support package.


    Create a Bluetooth LE node, specifying the role as "central".

    centralNode = bluetoothLENode("central");

    Create a Bluetooth LE node, specifying the role as "peripheral".

    peripheralNode = bluetoothLENode("peripheral");

    Create a default Bluetooth LE configuration object to establish a connection between the Central and Peripheral nodes.

    cfgConnection = bluetoothLEConnectionConfig;

    Configure the connection between the Central and Peripheral nodes.


    Create a networkTrafficOnOff object to generate an On-Off application traffic pattern. Specify the data rate in kb/s and the packet size in bytes. Generate an application packet with a payload by enabling packet generation. Add application traffic from the Central to the Peripheral node by using the addTrafficSource object function.

    traffic = networkTrafficOnOff(DataRate=50, ...
        PacketSize=20, ...

    Create a Bluetooth LE network consisting of a Central and a Peripheral node.

    nodes = {centralNode peripheralNode};
    numNodes = length(nodes);

    Set the current simulation time in seconds.

    currentTime = 0;

    Run the Bluetooth LE nodes at the current simulation time. The runNode object function returns the time instant at which the node runs again.

    for index = 1:numNodes
        nextInvokeTime = runNode(nodes{index},currentTime);

    If the transmit buffer has packet to be transmitted, the channelInvokeDecision object function performs these tasks.

    • Determines whether the receiving node wants to receive the packet.

    • Retrieves the receiver information required to apply the channel to the transmitted packet.

    If the node wants to receive the packet, apply the channel to the transmitted packet and push the data from the channel to the reception buffer by using the pushChannelData object function.

    for txIndex = 1:numNodes
        txNode = nodes{txIndex};
        txPacket = txNode.TransmitBuffer;
        if (txPacket.Type ~= 0)
            for rxIndex = 1:numNodes
                rxNode = nodes{rxIndex};
                [flag,rxInfo] = channelInvokeDecision(rxNode,txPacket);
                if flag
                    % Apply a path loss to the transmitted data in this comment
                    % line before pushing the data to the reception buffer

    Input Arguments

    collapse all

    Bluetooth LE node object, specified as a bluetoothLENode object.

    Packet received from the channel, specified as a structure with these fields.

    Structure Field Structure ValueDescription
    Type0, 1, 2, or 3

    Type of the incoming signal. Each value represents one of these packet types.

    • 0 — Invalid packet

    • 1 — WLAN packet

    • 2 — 5G packet

    • 3 — Bluetooth LE packet

    The default value is 0.

    TransmitterIDnonnegative scalar integerTransmitter node identifier
    TransmitterPositionnumeric row vector of length threePosition of the transmitter in Cartesian x-, y-, and z-coordinates. The value of this field is in the form [X Y Z]. Units are in meters.
    TransmitterVelocityreal-valued row vector of length three

    Velocity, v, of the transmitter in the x- y-, and z-directions. The value of this field is in the form [vx vy vz]. Units are in meters per second.

    StartTimepositive integerPacket transmission start time at the transmitter or packet arrival time at the receiver. Units are in seconds.
    Durationpositive integerDuration of the packet, in seconds
    PowerscalarTransmit power of the packet in dBm
    CenterFrequencyscalar positive integerCenter frequency of the carrier in Hz
    Bandwidthscalar positive integerCarrier bandwidth in Hz
    Abstraction0 (false) or 1 (true)Physical layer (PHY) abstraction type. A 1 (true) value represents the abstracted PHY. A 0 (false) value specifies the full PHY. The default value is 0 (false).
    SampleRatescalar positive integerSample rate of the packet in samples/second
    Datamatrix If you set the Abstraction field of the packet argument, this field specifies the in-phase and quadrature (IQ) samples of the packet as a M-by-N matrix, where M is the number of IQ samples and N is the number of Rx antennas. When the Abstraction field of the packet argument is set to 1 (true), this field has frame information.
    MetadatastructureTechnology specific or abstraction specific information, specified as a structure. The default value is an empty structure.

    Data Types: struct


    [1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 22, 2021.

    [2] Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification". v5.3.

    Version History

    Introduced in R2022a

    expand all

    R2023b: Removed

    The pushChannelData object function has been removed.