Main Content

generate

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

    Description

    example

    [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.

    [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.

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

    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 since the previous call of this object function, specified as a nonnegative scalar. This argument must be expressed in milliseconds.

    Data Types: double

    Output Arguments

    collapse all

    Time remaining to generate the next packet, returned as a nonnegative scalar. This argument must be expressed in milliseconds.

    Data Types: double

    Size of the current packet, returned as a positive scalar. The units of this argument are in bytes.

    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 ApplicationData property of the input cfg. 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 1 (true).

    Data Types: double

    Extended Capabilities

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

    Introduced in R2020b