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"
.
Create a Bluetooth LE node, specifying the role as "peripheral"
.
Create a default Bluetooth LE configuration object to establish a connection between the Central and Peripheral nodes.
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.
Create a Bluetooth LE network consisting of a Central and a Peripheral node.
Set the current simulation time in seconds.
Run the Bluetooth LE nodes at the current simulation time. The runNode
object function returns the time instant at which the node runs again.
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.
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.
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.