channelInvokeDecision
(To be removed) Determine whether to apply channel to incoming signal
Since R2022a
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
[
returns a flag, flag
,rxInfo
] = channelInvokeDecision(bluetoothLENodeObj
,packet
)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
Run Bluetooth LE Node
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.
wirelessnetworkSupportPackageCheck;
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
Warning: runNode will be removed in a future release. To simulate the Bluetooth LE node, use the <a href="matlab:doc('wirelessNetworkSimulator')">wirelessNetworkSimulator</a> object, instead.
Warning: runNode will be removed in a future release. To simulate the Bluetooth LE node, use the <a href="matlab:doc('wirelessNetworkSimulator')">wirelessNetworkSimulator</a> object, instead.
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 pushChannelData(rxNode,txPacket); end end end end
Warning: channelInvokeDecision will be removed in a future release. To simulate the Bluetooth LE node, use the <a href="matlab:doc('wirelessNetworkSimulator')">wirelessNetworkSimulator</a> object, instead.
Warning: channelInvokeDecision will be removed in a future release. To simulate the Bluetooth LE node, use the <a href="matlab:doc('wirelessNetworkSimulator')">wirelessNetworkSimulator</a> object, instead.
Warning: pushChannelData will be removed in a future release. To simulate the Bluetooth LE node, use the <a href="matlab:doc('wirelessNetworkSimulator')">wirelessNetworkSimulator</a> object, instead.
Input Arguments
bluetoothLENodeObj
— Bluetooth LE node object
bluetoothLENode
object
Bluetooth LE node object, specified as a bluetoothLENode
object.
packet
— Incoming packet
structure
Incoming packet, specified as a structure with these fields.
Structure Field | Structure Value | Description |
---|---|---|
Type | 0 , 1 , 2 , or
3 | Type of the incoming signal. Each value represents one of these packet types.
The default value is 0. |
TransmitterID | nonnegative scalar integer | Transmitter node identifier |
TransmitterPosition | numeric row vector of length three | Position 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. |
TransmitterVelocity | real-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. |
StartTime | nonnegative integer | Packet transmission start time at the transmitter or packet arrival time at the receiver. Units are in seconds. |
Duration | positive integer | Duration of the packet, in seconds |
Power | scalar | Transmit power of the packet in dBm |
CenterFrequency | scalar positive integer | Center frequency of the carrier in Hz |
Bandwidth | scalar positive integer | Carrier bandwidth in Hz |
Abstraction | 0 (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 ). |
SampleRate | scalar positive integer | Sample rate of the packet in samples/second |
Data | M 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. |
Metadata | structure | Technology specific or abstraction specific information, specified as a structure. The default value is an empty structure. |
Data Types: struct
Output Arguments
flag
— Flag indicating whether to invoke channel
0
or false
| 1
or true
Flag indicating whether to invoke channel, returned as a 0
(false
) or 1
(true
).
Data Types: logical
rxInfo
— Receiver information
structure
Receiver information, returned as a structure with these fields.
Structure Field | Structure Value | Description |
---|---|---|
ID | nonnegative scalar integer | Receiver node identifier |
Position | numeric row vector of length three | Position 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. |
Velocity | real-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 R2022aR2023a: Warns
The channelInvokeDecision
object function issues a warning that it will be
removed in a future release.
R2022b: To be removed
The channelInvokeDecision
object function will be removed in a future release.
To determine whether to apply channel to the incoming Bluetooth LE signal, use the wirelessNetworkSimulator
object, instead.
See Also
Objects
Functions
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)