/* Airpcap wrapper, used to set the frequency of an airpcap adapter  */
gboolean airpcap_if_set_device_channel_ex(PAirpcapHandle ah, AirpcapChannelInfo ChannelInfo)
/* Airpcap wrapper, used to set the frequency of an airpcap adapter  */
gboolean airpcap_if_set_device_channel_ex(PAirpcapHandle ah, AirpcapChannelInfo ChannelInfo)
{
    if (!AirpcapLoaded) return FALSE;
    if (airpcap_get_dll_state() == AIRPCAP_DLL_OLD){
        gint channel = 0;
        channel = ieee80211_mhz_to_chan(ChannelInfo.Frequency);
        if (channel < 0){
            return FALSE;
        } else {
            return airpcap_if_set_device_channel(ah, channel);
        }
    } else if (airpcap_get_dll_state() == AIRPCAP_DLL_OK){
        return g_PAirpcapSetDeviceChannelEx (ah, ChannelInfo);
    }
    return FALSE;
}