Programming Information for WiNRADiO WR-AMFE-8600 Antenna Multiplexer and Frequency Extender

The WR-AMFE-8600 API SDK is implemented as two 32-bit libraries: AMFE8600_API.DLL which contains the WR-AMFE-8600 API functions and supporting library AMFEUSB.DLL. The AMFE8600_API.DLL library provides operational functions for the WR-AMFE-8600 device utilizing the AMFEUSB.DLL library for communications with the device, so that AMFEUSB.DLL library is needed even though if it is not used directly. The API can be used by any 32-bit applications under Windows 98, ME, 2000, XP and Vista, and by 32-bit applications under 64-bit Windows XP and Vista.

How to use the WR-AMFE-8600 API SDK

  1. Load the AMFE8600_API.DLL library and get the exported functions.
  2. Use the GetDeviceCount to scan the USB bus for WR-AMFE-8600 devices, to obtain the count of WR-AMFE-8600 series devices found.
  3. You can then get serial number of each connected WR-AMFE-8600 device that was found on the USB bus by calling the GetDeviceSerial function.
  4. To open the desired WR-AMFE-8600 device by serial number, call the Open function.
  5. You can get the configuration of currently open device by calling the GetConfig function.
  6. Use the ConvertFrequency function to get the WR-AMFE-8600 device range to which you need to switch if you want to receive your desired signal, in addition to some other information.
  7. To switch the WR-AMFE-8600 device frequency range, use the SetRange function.
  8. To close the currently open WR-AMFE-8600 device, call the Close function.
  9. Unload the AMFE8600_API.DLL library from memory.


GetDeviceCount

Search the USB bus for WR-AMFE-8600 devices and return the count of found devices.

C/C++ declaration

       int GetDeviceCount(void);

Parameters

none

Return Value

This function returns the number of found WR-AMFE-8600 devices on the USB bus. The function can return -1 when the library failed to initialize.

Remarks

This function must be called before calling the GetDeviceSerial function. Returned value zero can mean that no device was found. If the return value is -1, you should check if the required libraries are available.

See Also

GetDeviceSerial


GetDeviceSerial

Retrieves the serial number of the found WR-AMFE-8600 device by the supplied index.

C/C++ declaration

       BOOL GetDeviceSerial(int DeviceIndex, char *serialNumber);

Parameters

DeviceIndex

Index of the WR-AMFE-8600 device of which you want to receive the serial number. This index can be from 0 to (GetDeviceCount() - 1).

serialNumber

Pointer to buffer of characters which will be filled with the WR-AMFE-8600 device serial number.

Return Value

If the function succeeds, the return value is non-zero. Otherwise, the return value is zero.

Remarks

Before calling this function, the GetDeviceCount function must be called. The size of the buffer to which the serialNumber pointer points to must be at least 20 bytes of size.

See Also

GetDeviceCount
Open


Open

Opens a WR-AMFE-8600 device specified by the serial number.

C/C++ declaration

       int Open(char *serialNumber);

Parameters

serialNumber

The serial number of a WR-AMFE-8600 device that you wish to open.

Return Value

The return value is a handle of the open WR-AMFE-8600 device. A valid handle is a number from 0 to 32. If the function fails, the return value is -1.

Remarks

Use this function to open a WR-AMFE-8600 device for further operation. The serial number of a connected WR-AMFE-8600 device can be retrieved by calling the GetDeviceSerial function.

See Also

Close
GetDeviceSerial


Close

Closes the currently open WR-AMFE-8600 device.

C/C++ declaration

       void Close(int amfeHandle);

Parameters

int amfeHandle

The handle of the open WR-AMFE-8600 series device which was returned from the Open function.

Return Value

none

Remarks

This function closes the currently open WR-AMFE-8600 device. If no device is open, then this function does nothing.

See Also

Open


IsOpen

Tells you if you have some WR-AMFE-8600 device open.

C/C++ declaration

       BOOL IsOpen(int amfeHandle);

Parameters

int amfeHandle

The handle of the open WR-AMFE-8600 device which was returned from the Open function.

Return Value

Returns non-zero value if some WR-AMFE-8600 device is open. Returns zero value if no device is open.

Remarks

Use this function to find out if you have some WR-AMFE-8600 device open.

See Also

Open


SetRange

Switch the WR-AMFE-8600 device range.

C/C++ declaration

       int SetRange(int amfeHandle, DWORD range);

Parameters

int amfeHandle

The handle of the open WR-AMFE-8600 device which was returned from the Open function.

range

The number of WR-AMFE-8600 range that you want to switch to. Allowed values are from 0 to 4.

Return Value

If the WR-AMFE-8600 device range was successfully switched, the return value is zero. In case of not successful range switch, the return value will be non-zero.

Remarks

To switch the WR-AMFE-8600 range, use this function. The WR-AMFE-8600 device must be opened before you can use this function. If you want to receive a specific frequency, use the ConvertFrequency function to find out the WR-AMFE-8600 device range that you need to switch if you want to receive that frequency.

See Also

ConvertFrequency
SetBeep


ConvertFrequency

Convert the WR-AMFE-8600 device input frequency to WR-AMFE-8600 device IF output frequency and return the required WR-AMFE-8600 device range that you need to switch to.

C/C++ declaration

       void ConvertFrequency(int amfeHandle, __int64 inputFrequency, __int64 *outputFrequency, DWORD *AMFErange, BOOL *IsInverted);

Parameters

int amfeHandle

The handle of the open WR-AMFE-8600 device which was returned from the Open function.

inputFrequency

The specific frequency that you want to receive through the WR-AMFE-8600 device in Hertz. Allowed values are from 0 Hz to 8600000000 Hz.

outputFrequency

Pointer to __int64 variable which will receive the frequency in Hertz to which you will need tune your receiver if you want to receive the inputFrequency. If you don't need to know this value, use a NULL pointer.

AMFErange

Pointer to DWORD variable which will receive the WR-AMFE-8600 device range to which you will need to switch your WR-AMFE-8600 unit. If you don't need to know this value, use a NULL pointer.

IsInverted

Pointer to BOOL variable which will receive the flag if the IF output of your WR-AMFE-8600 device will be inverted or not. If you don't need to know this, use a NULL pointer.

Remarks

The usage of this function is often paired with the usage of SetRange function. You don't have to have a WR-AMFE-8600 device open to use this function.

See Also

SetRange


SetBeep

Turn on and off the tones generation from WR-AMFE-8600 series device.

C/C++ declaration

       BOOL SetBeep(int amfeHandle, BOOL DoBeep);

Parameters

int amfeHandle

The handle of the open WR-AMFE-8600 device which was returned from the Open function.

DoBeep

A non-zero value causes that the WR-AMFE-8600 device generates tones from 0 to approx. 50 MHz. A zero value turns off the WR-AMFE-8600 device tones generation and partially suppresses input signals.

Return Value

Returns non-zero value if successful and zero value otherwise.

Remarks

You can use the WR-AMFE-8600 device tones generation for detection if the device is or isn't connected to your receiver. You should get higher signal levels with the tones generation turned on and lower signal levels with tones generation turned off. To return to normal operational mode, use the SetRange function to set a valid WR-AMFE-8600 device range after the turning off the tones generation.

See Also

SetRange


GetSSCorrection

Get signal strength correction value for the specified frequency.

C/C++ declaration

       float GetSSCorrection(int amfeHandle, unsigned __int64 Frequency);

Parameters

int amfeHandle

The handle of the open WR-AMFE-8600 device which was returned from the Open function.

Frequency

The frequency in Hz for which you want to retrieve signal strength correction value. This is the real-world frequency, not the converted one (i.e. the inputFrequency parameter of the ConvertFrequency function).

Return Value

Returns the signal strength correction in dB for the specified frequency.

Remarks

This function can be used to establish the true signal level at the AMFE input by summing the returned correction value with the output signal strength.

See Also

ConvertFrequency


GetConfig

Retrieves the configuration of currently open WR-AMFE-8600 device.

C/C++ declaration

       BOOL GetConfig(int amfeHandle, TAMFEconfig *lpAmfeConfig);

Parameters

int amfeHandle

The handle of an open WR-AMFE-8600 device which was returned from the Open function.

lpAmfeConfig

Pointer to the TAMFEconfig structure, which will be filled out by this function.

Return Value

Returns non-zero value if successful and zero value otherwise.

Remarks

If you need to find the serial number of the currently open WR-AMFE-8600 evice, or to determine if this is the WR-AMFE-8600HS model, or the avalailable ranges of this WR-AMFE-8600 device, use this function.

See Also

Open


IsAlive

Checks the communication between the WR-AMFE-8600 device and the API.

C/C++ declaration

       BOOL IsAlive(int amfeHandle);

Parameters

int amfeHandle

The handle of the open WR-AMFE-8600 device which was returned by the Open function.

Return Value

Returns non-zero value if communication with WR-AMFE-8600 device is OK, zero value otherwise.

Remarks

Use this function to find out if the WR-AMFE-8600 device communicates with the API. Note that you must have the WR-AMFE-8600 device open to use this function. You should close the connection to the device if it does not communicate with the API.

See Also

Open
Close


Exported functions from AMFE8600_API.DLL:


Definition of structure TAMFEconfig

typedef struct
{
char szSerialNumber[20];
BOOL bIsHS;
TAMFErange AMFEranges[5];
} TAMFEconfig;
szSerialNumber - serial number of WR-AMFE-8600 device
bIsHS - the value is non-zero for WR-AMFE-8600HS device. If the value is zero, it is a WR-AMFE-8600 device.
AMFEranges - the field of TAMFErange structures which define the ranges of the connected WR-AMFE-8600 device.


Definition of structure TAMFErange

typedef struct
{
__int64 i64MinFreqHz;
__int64 i64MaxFreqHz;
__int64 i64LOFreqHz;
BOOL bIsInverted;
} TAMFErange;
i64MinFreqHz - the minimum frequency of range in Hertz
i64MaxFreqHz - the maximum frequency of range in Hertz
i64LOFreqHz - the frequency of local oscillator of the range in Hertz
bIsInverted - a flag which determines if the spectrum is or is not inverted


AMFE-8600 API usage example

A functional WR-AMFE-8600 API usage example written in C++ (Visual C++ 2003) can be downloaded here.