Are you saying "I have an 802.11 card and, in Windows CE.NET, I want to know
how strong the RF signal is to the card?" If so, I've posted code in the
eVC newsgroup in the past showing how to do this from C. It basically comes
down to using the NDISUIO driver, passing it the name of the network adapter
to query and a particular OID to get the RF information, and then
interpreting that information. You'll have to P/Invoke at least a couple of
functions to do it from .NET CF programs, but I think that it should be
doable. If you are not targeting Windows CE.NET, you need to tell us what
you *are* targeting...
I talk about IPAQ with .NET compact Framework. my application must run on
different IPAQ some with "Symbol Companion" some other with the wireles
integretated.
My application run in full connected. So i the user try to save and it was
out of range... i whan to a message with a Signal meter to find a "connected
zone".
How can i know the strenght of the signal?
--
____________________
Franky
(e-mail address removed)
As I said, I've posted C++ code that will give you the signal strength. The
possible problem will be on Windows CE 3.0-based devices, if you have any of
those. If they are all Windows CE.NET/Pocket PC 2003 or later, it will work
fine.
You can search the Windows CE (non-.NET CF groups), from this link:
Sorry, I don't have time to build you a C++ DLL that could be called from
..NET CF, at the moment. I'll try to get to it at some point, but real work
beckons today...
Also I'm sure I'm not the only one considering just going ahead and making
the control. I think it is a greatly needed component.
I'd be surprised if some don't show up shortly.
I belive location services are a big part of the next version of the compact
framework so I expect this kind of data to be readily available by then.
Hi,
Does I need to install something in particular? I got a Error ( An
unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in
mscorlib.dll ) in runtime at :
protected IP_ADAPTER_INFO( byte[] datain, uint offset )
{
// Create an internal-only copy of this structure,
// making it easy to get to the fields of one
// of the items in the linked list, based on its
// offset within the byte[] of the main
// instance of an IP_ADAPTER_INFO.
ourSize = IP_ADAPTER_INFO_SIZE;
data = new byte[ IP_ADAPTER_INFO_SIZE ];
// just at this command...
Array.Copy( datain, (int)offset, data, 0, IP_ADAPTER_INFO_SIZE );
}
There may be a problem on the device you are trying. What device and
version of the OS is it? In particular, on the first call to
GetAdaptersInfo(), the value returned in 'size' is supposed to be the size
of the buffer needed to hold the complete data on all adapters in the
system. If that is coming back as zero, you might easily get the error you
mention.
hi Paul, thanks for all youe time, I really appreciate.
I use a IPAQ 3650 with Symbol Companion sps3000.
After writing you the last message a try to debug and on the first call to
GetAdaptersInfo() a got a error but the value of Size is set to 1000. So I
change the size of
protected const int IP_ADAPTER_INFO_SIZE to 1000.
Now a can run! But is all the time :"Not an RF adapter" in the cradle (ppp)
or wireless (NETWLAN1)...
No, you don't want to do that. The size returned by the first call to
GetAdaptersInfo() is already used to allocate the buffer and it's a much
better number than the IP_ADAPTER_INFO_SIZE, which is only used when
constructing an IP_ADAPTER_INFO instance for one of the items in the linked
list returned by GetAdaptersInfo(). That is, when you try to extract entry
three in the linked list, a different constructor is used and it copies the
right bytes out of the linked list and into its own byte[]. If you do what
you did there, enumeration of the list of adapters will *not* work
correctly.
You *should* get an error from that first call to GetAdaptersInfo() (you're
passing it a null pointer and a size of zero, so you get a 'buffer not big
enough error'). However, it also returned the right size to use. If you
look at the code, I'm using that fact to figure out how much memory to
allocate.
If you set the IP_ADAPTER_INFO_SIZE back to the right value, we should be
able to continue. Trace into the rfSignalStrengthString() call made when
you click on the Get Signal Strength button. Trace into
rfSignalStrengthDB(), which is the function which actually calls the NDISUIO
driver to get the information. In that routine, we need to be sure that the
CreateFile() call works. If it does not, your device may not have NDISUIO
on it and my scheme will not work. If the CreateFile is successful,
however, step through the rest of the routine. I would guess that the
problem is that DeviceIoControl() is returning FALSE. There may be a
problem with one of the constants that I'm passing or something. Let me
know on that.
the CreateFile() call works not work... on my devlope Device... IPAQ
(ppc2002) but when a try it on the real project device (ppc2003) it work
perfectly!
Dang it. It sounds like NDISUIO is not supported on your PPC2002 device.
That's unfortunate, but not totally unexpected. It should work on all
PPC2003s, if it works on one, and on any Windows CE.NET, non-PPC2003
devices, that have the NDISUIO component included.