Networking Forums

Networking Forums > Wireless Networking > Wireless Networks > WlanConnect not working

Reply
Thread Tools Display Modes

WlanConnect not working

 
 
hari
Guest
Posts: n/a

 
      05-01-2009, 06:54 PM
Hi all,

I am trying to use WlanConnect to a connect to a ad-hoc network. I am
getting the error invalid parameter.

I know the ssid of the ad-hoc network and wanna connect to it using the ssid
and not the profile name. It is an unsecure network. I found samples on the
net to connect to wifi network using the profile name and tat works for me..
but I want to connect using the SSID...

Here is the code

WLAN_CONNECTION_PARAMETERS wlanConnPara;

// set the connection mode
wlanConnPara.wlanConnectionMode = wlan_connection_mode_discovery_unsecure;

// set the profile name
wlanConnPara.strProfile = NULL;

// set the SSID
DOT11_SSID Ssid={0};
string strSsid = "harinetwork";
Ssid.uSSIDLength = (ULONG)strSsid.size();
memcpy(&Ssid.ucSSID, strSsid.c_str(), strSsid.size());

wlanConnPara.pDot11Ssid = &Ssid;

wlanConnPara.dot11BssType = dot11_BSS_type_independent;

// the desired BSSID list is empty
wlanConnPara.pDesiredBssidList = NULL;

// no connection flags
wlanConnPara.dwFlags = 0;

if((error = WlanConnect(hClient,&guid,&wlanConnPara,NULL)) == ERROR_SUCCESS)
{
cout<<"Done"<<endl;
}
else
{
cout<<"error "<<error<<endl;
}
 
Reply With Quote
 
 
 
 
Jack [MVP-Networking]
Guest
Posts: n/a

 
      05-01-2009, 11:18 PM
Hi
Knowing the SSID of Ad-Hoc Network does not mean that you can connect to
it.
There can be other element that are needed to configure, and in some cases
that can be a None computer device that you can not connect to at all.
Jack (MS, MVP-Networking)

"hari" <(E-Mail Removed)> wrote in message
news:C722638B-8D5A-4CF6-A366-(E-Mail Removed)...
> Hi all,
>
> I am trying to use WlanConnect to a connect to a ad-hoc network. I am
> getting the error invalid parameter.
>
> I know the ssid of the ad-hoc network and wanna connect to it using the
> ssid
> and not the profile name. It is an unsecure network. I found samples on
> the
> net to connect to wifi network using the profile name and tat works for
> me..
> but I want to connect using the SSID...
>
> Here is the code
>
> WLAN_CONNECTION_PARAMETERS wlanConnPara;
>
> // set the connection mode
> wlanConnPara.wlanConnectionMode = wlan_connection_mode_discovery_unsecure;
>
> // set the profile name
> wlanConnPara.strProfile = NULL;
>
> // set the SSID
> DOT11_SSID Ssid={0};
> string strSsid = "harinetwork";
> Ssid.uSSIDLength = (ULONG)strSsid.size();
> memcpy(&Ssid.ucSSID, strSsid.c_str(), strSsid.size());
>
> wlanConnPara.pDot11Ssid = &Ssid;
>
> wlanConnPara.dot11BssType = dot11_BSS_type_independent;
>
> // the desired BSSID list is empty
> wlanConnPara.pDesiredBssidList = NULL;
>
> // no connection flags
> wlanConnPara.dwFlags = 0;
>
> if((error = WlanConnect(hClient,&guid,&wlanConnPara,NULL)) ==
> ERROR_SUCCESS)
> {
> cout<<"Done"<<endl;
> }
> else
> {
> cout<<"error "<<error<<endl;
> }


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
previously working wireless connection no longer working zapspan Wireless Networks 5 01-17-2010 09:11 PM
Ad hoc connection working, but ICS not working. Any help? Brian O Wireless Networks 6 09-29-2007 03:58 PM
Re: Native WIFI SDK - Windows XP SP2 - WlanConnect problem Yi Lu [MSFT] Wireless Networks 0 05-10-2007 12:14 AM
wifi not working on new hp, or not working after live update Dragonx Wireless Networks 1 10-01-2005 11:17 PM
Kernel-nfs working, plain nfs not working. alw Linux Networking 0 09-23-2003 11:14 PM



1 2 3 4 5 6 7 8 9 10 11