- OID_802_11_BSSID_LIST_SCAN
- Posted by Wojciech F. on May 26th, 2005
I try to get signal strength and MAC's of all access points in user-mode. I
try to make it without NDISUIO writing in pure C.
I made a little app which uses WMI and Setup Api to find wireless network
card.
Unfortunately I do not know how to SET OID_802_11_BSSID_LIST_SCAN oid.
Passing it to DeviceIoControl with IOCT_QUERY_GLOBAL_STATS returns FALSE
and error: "50. The network request is not supported."
ERROR_NOT_SUPPORTED".
Although using only the query: OID_802_11_BSSID_LIST seems to work (list
refreshes itself) but e.g. when I run Netstumbler (during work of my app)
DeviceIoControl fails and getlasterror() shows error: "31 A device attached
to the system is not functioning. ERROR_GEN_FAILURE ". And the most
irritating thing is, that Netstumbler sees more access points than my
programm.
help.....
--
Thanks,
Wojtek
E-mail hint: add [usenet] to the subject
"Ipsa scientia potestas est."
- Posted by Pavel A. on May 26th, 2005
"Wojciech F." <"vankaszaner[REMOVE_IT]" wrote:
Exactly so. One can't pass this OID from user mode thru WMI and, of course,
not thru IOCT_QUERY_GLOBAL_STATS. This is "by design".
Maybe you don't need to set it at all. Driver of the wireless card scans
automatically from time to time. All you need is get OID_802_11_BSSID_LIST.
Buffer is too small??
- Posted by Thomas F. Divine [DDK MVP] on May 26th, 2005
"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message
news:1rvbva82kaysf$.dlg@tofik.homeip.net...
information. For these adapters he uses non-NDIS adapter-vendor proprietary
APIs to fetch information that isn't accessable through NDIS. This
information is only available through license agreements with adapter
vendors.
When NetStumbler is in use it is certainly possible that the adapter may
appear to be non-functional to Windows (Although I haven't seen this
behavior myself.) No, I am not the NetStumbler author, although some
versions of NetStumbler do use PCAUSA NDIS protocol drivers.
As Pavel A. said the OS periodically makes the OID_802_11_BSSID_LIST_SCAN
call at about 60-second intervals. So, about 83% of the time you should get
a complete BSSID list if you query the OID_802_11_BSSID_LIST using WMI or
IOCT_QUERY_GLOBAL_STATS.
Do be sure to pass a LARGE buffer to be filled with list items when you make
the query.
Good luck,
Thomas F. Divine, Windows DDK MVP
http://www.rawether.net
- Posted by iwub on May 27th, 2005
I have done this, sure that it is OK on XP SP2.
try again , and your params OK ?
"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl>
??????:1rvbva82kaysf$.dlg@tofik.homeip.net...
- Posted by Wojciech F. on May 27th, 2005
Unfortunately I need to call OID_802_11_BSSID_LIST_SCAN every 1-2sec. I'm
working on WLAN positioniong system, so I have to get most current AP list
with RSSI. Using NDISUIO it seems to be piece of cake:
//whole code works perfectly
PNDISUIO_SET_OID pSetOid = (PNDISUIO_SET_OID) &Buf[0];
pSetOid->Oid = OID_802_11_BSSID_LIST_SCAN;
if (!DeviceIoControl(h,IOCTL_NDISUIO_SET_OID_VALUE,(L PVOID) &Buf[0],
sizeof(Buf), (LPVOID) &Buf[0],0,&bytes,NULL))
{
DWORD res=GetLastError();
return res;
}
PNDISUIO_QUERY_OID pQueryOid = (PNDISUIO_QUERY_OID) &Buf[0];
pQueryOid->Oid = OID_802_11_BSSID_LIST;
if (!DeviceIoControl(h, IOCTL_NDISUIO_QUERY_OID_VALUE, &Buf[0],
sizeof(Buf), &Buf[0], sizeof(Buf), &bytes, NULL))
{
DWORD res=GetLastError();
return res;
}
================================================== ==========
And my current case:
ULONG oid;
oid=OID_802_11_BSSID_LIST_SCAN;
//it always fails with ERROR_NOT_SUPPORTED
//OIDScope from PCAUSA shows OID_802_11_BSSID_LIST_SCAN in list of
//supported OIDs
if (!DeviceIoControl(h,IOCTL_NDIS_QUERY_GLOBAL_STATS, &oid, sizeof(oid),
(LPVOID) &Buf[0],sizeof(Buf),&bytes,NULL))
{
DWORD res=GetLastError();
return res;
}
//does not fail
oid=OID_802_11_BSSID_LIST;
if (!DeviceIoControl(h,IOCTL_NDIS_QUERY_GLOBAL_STATS, &oid, sizeof(oid),
(LPVOID) &Buf[0],sizeof(Buf),&bytes,NULL))
{
DWORD res=GetLastError();
return res;
}
Buffer is big enough now. It fails with ERROR_GEN_FAILURE no more even with
networkstumbler in background.
--
Thanks,
Wojtek
E-mail hint: add [usenet] to the subject
"Ipsa scientia potestas est."
- Posted by Pavel A. on May 27th, 2005
"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message news:1b2cj2tbnczdv.dlg@tofik.homeip.net...
Sure enough, it will fail.
IOCTL_NDIS_QUERY_GLOBAL_STATS always does Query, but
OID_802_11_BSSID_LIST_SCAN works only if you Set it.
Getting OID_802_11_BSSID_LIST is a Query, thus it works.
So you do need something like ndis transport driver or ask the manufacturer of the wireless adapter to help.
Maybe there is a parameter that tells the driver to refresh scan results more frequently.
Also, note that OID_802_11_BSSID_LIST_SCAN does not produce
new scan results immediately. It only starts the scan. The adapter or driver complete it
when they can.
Regards,
--PA
- Posted by Wojciech F. on May 30th, 2005
Yes. I wrote already that I don't know how to SET that oid. But I wonder
how does it make NDISUIO service. It seems to support a lots of w-lan cards
(i tested it with 5 different cards). I can't belive that it uses a magic
parameters specific for each card's manufacturer.
When I use NDISUIO and I set OID..._SCAN it seems to do real scan, because
I need to wait a little bit longer until DeviceIoControl funcion returns.
It is clearly noticeable on PocketPC. Sometimes it takes 2s until function
returns and after reading the list through the oid.._list it always differs
(new accespoints, rssi).
--
Thanks,
Wojtek
E-mail hint: add [usenet] to the subject
"Ipsa scientia potestas est."
- Posted by Pavel A. on May 31st, 2005
"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message news:1e9nxskr0q8le$.dlg@tofik.homeip.net...
NDISUIO (or clones of DDK Ndisprot sample ) is a real NDIS transport driver, so the full set of NDIS intefaces is available to
it.
It is an universal vehicle to send any NDIS request to 3rd party netcard drivers.
It has nothing specific to wi-fi. Just study the ndisprot sample.
(if you work on WinCE OS, there it is different. I'm talking about NT based Windows).
Depends on the netcard driver. Scan can and should run asynchronously.
Holding the caller for 2 seconds is bad.
Regards,
--PA
- Posted by Wojciech F. on June 3rd, 2005
Tue, 31 May 2005 22:09:29 +0300,
microsoft.public.development.device.drivers, Pavel A.:
thanks for discussion, friend.
--
Thanks,
Wojtek
E-mail hint: add [usenet] to the subject
"Ipsa scientia potestas est."
- Posted by Arsalan Ahmad on June 3rd, 2005
But what I have noted is that I have to wait 3 to 5 sec using Sleep() before
calling OID_...SCAN and OID_..._LIST otherwise i dont get the updated list.
"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message
news:4t4am2hkiwo2.dlg@tofik.homeip.net...
- Posted by Thomas F. Divine [DDK MVP] on June 3rd, 2005
"Arsalan Ahmad" <arsal__@hotmail.com> wrote in message
news:egvBYRGaFHA.796@TK2MSFTNGP10.phx.gbl...
timing between starting a list scan and fetching the list. See:
http://msdn.microsoft.com/library/de...2ea2a9.xml.asp
(Beware of wrap...)
Good luck,
Thomas F. Divine, Windows DDK MVP
http://www.rawether.net
- Posted by Arsalan Ahmad on June 3rd, 2005
sorry..what i wanted to say is what I have noted is that I have to wait 3 to
5 sec using Sleep() between
calling OID_...SCAN and OID_..._LIST otherwise i dont get the updated list
i.e.
Call OID_...LIST_SCAN
Wait for 3 or 5 sec
Call OID_LIST
"Arsalan Ahmad" <arsal__@hotmail.com> wrote in message
news:egvBYRGaFHA.796@TK2MSFTNGP10.phx.gbl...