Check Signal

F

Franky

How can I check the network signal like a signal meter?


____________________
Franky
(e-mail address removed)
 
P

Paul G. Tobey [eMVP]

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...

Paul T.
 
F

Franky

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)


"
 
P

Paul G. Tobey [eMVP]

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:

http://groups.google.com/groups?hl=en&group=microsoft.public.windowsce

Here's the thread I mentioned:

http://groups.google.com/groups?hl=...gth&meta=group%3Dmicrosoft.public.windowsce.*

Paul T.
 
F

Franky

Wow is look complexe!

Does a can mixte C# and C++? I think no.
Do you have a idea for use the GetSignalStrength() in my c# project?

I try to make C++ .net DLL with the code, bit my c++ is so poor... i
failed. :(

Can you help me please...

____________________
Franky
(e-mail address removed)
 
P

Paul G. Tobey [eMVP]

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...

Paul T.
 
C

Chris Craft

I posted this earlier maybe it will help.

Symbol has an SDK for there products like HP has an SDK for their iPaq
products.
http://devzone.symbol.com/login.cfm?return=/content.cfm?item_id=59EB6151-05FF-46B4-AF73F44E6145C121
http://www.ipaqdeveloper.com/ids/login.asp
Both of these companies have written custom controls that will report signal
strength.
Symbol has one for .NET Compact Framework and HP has a native dll that can
be P-invoked.
ViewSonic also has a Wireless Signal Strength Indicator custom control.
http://www.viewsonic.com/vsolutions/microsoft_dev/
There is very strong competion in the Pocket PC OEM market, so I imagine the
controls are locked down
to avoid being used by their competiors. Or they could only work with the
exact hardware in their device.

You'll probably want to write a native code dll to get the information and
pinvoke it, if you want it to work for most devices.

Paul G. Tobey has kindly shared the following which is where you will need
to start.

http://groups.google.com/groups?hl=...gth&meta=group%3Dmicrosoft.public.windowsce.*

Alex Feinman has posted the GetAdaptersInfo() API you will need.

You will have to P/Invoke the GetAdaptersInfo() API call in iphlpapi.dll.
http://www.alexfeinman.com/download.asp?doc=AdapterInfo.zip

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.

Thanks,
Chris Craft
http://www.cjcraft.com/
 
F

Franky

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 );
}
 
P

Paul G. Tobey [eMVP]

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.

Paul T.
 
F

Franky

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)...

So it is possible to get the signal ?

Thanks againt.

____________________
Franky
(e-mail address removed)
 
P

Paul G. Tobey [eMVP]

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.

Paul T.
 
F

Franky

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!

So the problem is my Extansion Pack Symbol...

Thanks againt for all yours help.

____________________
Franky
(e-mail address removed)
 
P

Paul G. Tobey [eMVP]

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.

Paul T.
 
P

Paul G. Tobey [eMVP]

Sounds like they basically did what I posted the other day, since it only
works on PPC2003.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top