niWLANG_ChannelNumberToCarrierFrequency

NI WLAN Generation Toolkit 18.0 Help

Edition Date: October 2018

Part Number: 373725J-01

»View Product Info
Download Help (Windows Only)

int32 __stdcall niWLANG_ChannelNumberToCarrierFrequency (int32 frequencyBand, float64 channelBandwidth, int32 channelNumber, int32 secondaryFactor, float64 channelStartingFactor, float64 *carrierFrequency);

Purpose

Calculates the carrier frequency according to the numbering scheme by converting a set of input parameters, including the channel number, for IEEE 802.11a/b/g/j/n/p, IEEE 802.11ac, IEEE 802.11ah, IEEE 802.11af, and IEEE P802.11ax/D3.0 standards.

Parameters

Input
Name Type Description
frequencyBand int32

Specifies whether to use the 2.4 GHz or the 5 GHz band. The default value is NIWLANG_VAL_FREQUENCY_BAND_2p4GHZ.

NIWLANG_VAL_FREQUENCY_BAND_2p4GHZ (0) Specifies a frequency band of 2.4 GHz.
NIWLANG_VAL_FREQUENCY_BAND_5GHZ (1) Specifies a frequency band of 5 GHz.
channelBandwidth float64 Specifies the channel bandwidth Valid values are 5 MHz, 10 MHz, 20 MHz, and 40 MHz. This value is expressed in Hz.
channelNumber int32 Specifies the offset of the center frequency above the starting frequency of the channel.

When you set the channelBandwidth parameter to 40 MHz, the channelNumber parameter is the primary channel number and the corresponding channel center frequency is the primary channel center frequency. This value is expressed in increments of 5 MHz.

secondaryFactor int32 Specifies whether the secondary channel is above or below the primary channel when you set the channelBandwidth parameter to 40 MHz. The toolkit creates a 40 MHz channel by combining the primary channel and the secondary channel, where the channels have a bandwidth of 20 MHz.

The secondary channel number is given by the following formula:

secondary channel number = primary channel number + (4 * secondary factor)

The secondary channel center frequency is given by the following formula:

secondary channel center frequency (Hz) = channel starting frequency (Hz) + (secondary channel number * 5 MHz)

Valid values are -1 and +1.

channelStartingFactor float64

Specifies the value used to define the baseline frequency. The channel start frequency is given by the following formula:

channel starting frequency (Hz) = channel starting factor * 500 kHz)

Output
Name Type Description
carrierFrequency float64* Returns the carrier frequency. This value is expressed in Hz.

This function calculates the carrier frequency using the following equation:

Carrier frequency (Hz) = channel starting frequency (Hz) + (channel number * 5 MHz).

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to the function to determine if an error occurred.

To obtain a text description of the status code, call the niWLANG_GetErrorString function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

WAS THIS ARTICLE HELPFUL?

Not Helpful