Main Content

generate

Generate next FTP, On-Off, VoIP, or video conference application traffic packet

Since R2020b

Download Required: To use generate, first download the Communications Toolbox Wireless Network Simulation Library add-on.

Description

[dt,packetSize] = generate(cfg) generates the next FTP, On-Off, VoIP, or video application traffic pattern based on the specified configuration object, cfg. The object function returns the time remaining to generate the next packet, dt, and the size of the current packet, packetSize.

example

[dt,packetSize] = generate(cfg,elapsedTime) specifies the time elapsed, elapsedTime, since the previous call of this object function.

[___,packet] = generate(___) returns the FTP, On-Off, VoIP, or video application traffic packet. Specify an argument combination from any of the previous syntaxes.

example

Examples

collapse all

Create a VoIP application traffic pattern object, disabling modeling of jitter.

cfgVoIP = networkTrafficVoIP(HasJitter=false);

Generate a VoIP application traffic pattern.

[dt,packetSize] = generate(cfgVoIP); 

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

Input Arguments

collapse all

Configuration object to generate FTP, On-Off, VoIP, or video application traffic pattern, specified as a networkTrafficFTP, networkTrafficOnOff, networkTrafficVoIP, or networkTrafficVideoConference object.

Time elapsed in milliseconds since the previous call of this object function, specified as a nonnegative scalar.

Data Types: double

Output Arguments

collapse all

Time remaining in milliseconds to generate the next packet, returned as a nonnegative scalar.

Data Types: double

Size of the current packet in bytes, returned as a positive scalar.

Data Types: double

Application data packet, returned as a column vector of integers in the range [0, 255]. This value contains the application data specified by the cfg.ApplicationData property. If the ApplicationData property is not specified, packet is a column vector of 1s.

Dependencies

To enable this output argument, set the GeneratePacket property of the input cfg to true.

Data Types: double

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2020b

expand all