Generate next On-Off application traffic packet
Generate On-Off Application Traffic Pattern and Data Packet
Create an On-Off application traffic pattern object to generate an On-Off data packet.
cfgOnOff = networkTrafficOnOff('GeneratePacket',true);
Generate an On-Off application traffic pattern and data packet.
[dt,packetSize,packet] = generate(cfgOnOff);
cfgOnOff — Configuration object to generate On-Off application traffic pattern
Configuration object to generate an On-Off application traffic pattern, specified as
elapsedTime — Time elapsed since previous call of this object function
Time elapsed since the previous call of this object function, specified as a nonnegative scalar. Units are in milliseconds.
dt — Time remaining to generate next packet
Time remaining to generate the next packet, returned as a nonnegative scalar. Units are in milliseconds.
packetSize — Size of current packet
Size of the current packet, returned as a positive scalar. Units are in bytes.
packet — Application data packet
column vector of integers in the range [0, 255]
Application data packet, returned as a column vector of integers in the range [0,
255]. This output contains application data that the
ApplicationData property of the input
cfgOnOff specifies. If you do not specify
ApplicationData, this output is a column vector of 1s.
To enable this output argument,
GeneratePacket property of the
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced in R2022a