pushChannelData
pushChannelData
will be removed in a future release. To push data from the
channel to the reception buffer of the Bluetooth LE node, use the wirelessNetworkSimulator
object, instead.
Description
pushChannelData(
pushes the packet bluetoothLENodeObj
,packet
)packet
from the channel to the reception buffer of
the Bluetooth® low energy (LE) node specified by the bluetoothLENodeObj
object.
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
— Packet received from channel
structure
Packet received from the channel, 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, 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. |
StartTime | positive 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 | 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
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". v5.3. https://www.bluetooth.com/.
Version History
Introduced in R2022aR2023a: Warns
The pushChannelData
object function issues a warning that it will be
removed in a future release.
R2022b: To be removed
The pushChannelData
object function will be removed in a future release.
You can push data from the channel to the reception buffer of the Bluetooth LE node by using
the wirelessNetworkSimulator
object, instead.
See Also
Objects
Functions
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)