Computes the carrier frequency of the Bluetooth signal to generate based on the value that you specify in the channelNumber parameter. The BT Generation computes the center frequency according to section 2, Part A, Volume 2 of the Bluetooth Specification Version 4.2.

Syntax

int32 __stdcall niBTSG_ChannelNumberToCarrierFrequency(int32 channelNumber, int32 standard, float64 *carrierFrequency)

Remarks

The Bluetooth system operates in the 2.4 GHz ISM band. This frequency band is 2,400 MHz to 2,483.5 MHz. RF channels are spaced 1 MHz apart and are ordered in channel number k according to the following formula: f = 2,402 + k MHz, where k = 0, 1, ..., 78 for Basic Rate/Enhanced Data Rate packets and f = 2,402 + (2 * k) MHz, where k = 0, 1, ..., 39 for a Low Energy packet, and f is the frequency of the RF channels.

Parameters

NameDirectionTypeDescription
channelNumber[in]int32

Specifies the channel number.

standard[in]int32

Specifies the standard. The default value is NIBTSG_STANDARD_BASIC_OR_EDR.

NIBTSG_STANDARD_BASIC_OR_EDR(0)

Specifies that the standard is basic rate or enhanced data rate (EDR).

NIBTSG_STANDARD_LE(1)

Specifies that the standard is low energy (LE).

carrierFrequency[out]float64 *

Returns the RF frequency (f) corresponding to the channel number k, where f = 2,402 + k MHz.

Returns

Returns the status code of this operation. The status code either indicates success or describes an error or warning. Examine the status code from each call to an niBT SG function to determine if an error has occurred. To obtain a text description of the status code and additional information about the error condition, call the niBTSG_GetErrorString function. The general meaning of the status code is as follows:

Value

Meaning

0

Success

Positive Values

Warnings

Negative Values

Errors