Main Content

channelInvokeDecision

(To be removed) Determine whether to apply channel to incoming signal

    channelInvokeDecision will be removed in a future release. To determine whether to apply channel to the incoming Bluetooth LE signal and simulate the Bluetooth LE node, use the wirelessNetworkSimulator object, instead.

    Description

    example

    [flag,rxInfo] = channelInvokeDecision(bluetoothLENodeObj,packet) returns a flag, flag, indicating whether the Bluetooth® low energy (LE) node specified by the bluetoothLENodeObj object wants to receive the packet packet. The function also returns the receiver information rxInfo required to apply the channel to the incoming packet.

    Examples

    collapse all

    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.

    configureConnection(cfgConnection,centralNode,peripheralNode);

    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, ...
        GeneratePacket=true);
    addTrafficSource(centralNode,traffic,"DestinationNode",peripheralNode.Name);

    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);
    end

    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};
        if (txNode.TransmitBuffer.Type ~= 0)
            txPacket = txNode.TransmitBuffer;
            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
                    pushChannelData(rxNode,txPacket);
                end
            end
        end
    end

    Input Arguments

    collapse all

    Bluetooth LE node object, specified as a bluetoothLENode object.

    Incoming packet, 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 of the transmitter in x-, y-, and z-directions. The value of this field is in the form [vx vy vz], where v is the velocity. Units are in meters per second.

    StartTimenonnegative 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
    DataM x N matrix 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

    Output Arguments

    collapse all

    Flag indicating whether to invoke channel, returned as a 0 (false) or 1 (true).

    Data Types: logical

    Receiver information, returned as a structure with these fields.

    Structure Field Structure ValueDescription
    IDnonnegative scalar integerReceiver node identifier
    Positionnumeric row vector of length threePosition of the receiver in Cartesian x-, y-, and z- coordinates. The value of this field is in the form [X Y Z]. Units are in meters.
    Velocityreal-valued row vector of length three

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

    The object function uses this output to apply the channel to the incoming packet.

    Data Types: struct

    References

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

    Version History

    Introduced in R2022a

    expand all