Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NDIS wlan driver for EVB

19 views
Skip to first unread message

mtz

unread,
Oct 10, 2003, 2:50:01 PM10/10/03
to
Hi,

I'd like to work with WLAN in my EVB program, and I heard that there are
a driver to do this: NDIS, but I can find any information about this, an
d how to use it with the Embedded Visual Basic...

Code snippets are highly appreciated.

Please reply to the group.

Thanks in advance.

Ricardo Mtz.

Paul G. Tobey [eMVP]

unread,
Oct 10, 2003, 4:29:30 PM10/10/03
to
What you've heard isn't quite right. NDIS is the 'framework' into which the
drivers for the actual network hardware have to fit in order to work. That
is, the NDIS specification tells the guy who's writing the driver what
functions he has to implement and how. You don't really talk to NDIS to do
'things' over the network; it just provides the services that the
programming interfaces which you *do* use call to do things for you.

What, specifically, do you want to do over the WLAN on your device (and what
kind of device is it: Pocket PC, Pocket PC 2002, Pocket PC 2003, something
else?)?

Paul T.

"mtz" <rmar...@hotpop.com> wrote in message
news:Oi6RP91j...@tk2msftngp13.phx.gbl...

mtz

unread,
Oct 11, 2003, 6:46:38 AM10/11/03
to
Hi Paul,

I need to get wlan signal strenght and various other information from
the WLAN. And I'd like to change the IP address for the WLAN.

Thanks a lot.

Ricardo mtz.

Paul G. Tobey [eMVP]

unread,
Oct 13, 2003, 3:42:33 PM10/13/03
to
You can get signal strength via NDISUIO, (not NDIS itself). NDISUIO is a
driver which provides a (somewhat) documented interface to internal
information such as what you're talking about. Here's a C function (there
aren't going to be any VB examples to speak of), that gets the signal
strength from a selected adapter:

// GetSignalStrength based on the function of the same name in the NETUI
// driver in CE.NET 4.2.
HRESULT GetSignalStrength( TCHAR *ptcDeviceName, INT* piSignalStrength )
{
PNDISUIO_QUERY_OID queryOID;
DWORD dwBytesReturned = 0;
UCHAR QueryBuffer[sizeof(NDISUIO_QUERY_OID)+sizeof(DWORD)];
HANDLE ndisAccess = INVALID_HANDLE_VALUE;
BOOL retval;
HRESULT hr;

// Attach to NDISUIO.
ndisAccess = CreateFile( NDISUIO_DEVICE_NAME, 0, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, INVALID_HANDLE_VALUE );
if ( ndisAccess == INVALID_HANDLE_VALUE )
return E_FAIL; // ????

// Get Signal strength
queryOID = (PNDISUIO_QUERY_OID)&QueryBuffer[0];
queryOID->ptcDeviceName = ptcDeviceName;
queryOID->Oid = OID_802_11_RSSI;

retval = DeviceIoControl( ndisAccess,
IOCTL_NDISUIO_QUERY_OID_VALUE,
(LPVOID) queryOID,
sizeof(NDISUIO_QUERY_OID) + sizeof(DWORD),
(LPVOID) queryOID,
sizeof(NDISUIO_QUERY_OID) + sizeof(DWORD),
&dwBytesReturned,
NULL);
if( retval && piSignalStrength )
{
hr = S_OK;
*piSignalStrength = *(DWORD *)&queryOID->Data;
}
else
{
hr = E_FAIL;
}

CloseHandle( ndisAccess );

return hr;

}

It takes the device name and returns the strength in dB. You can find a
list of device names by calling GetAdaptersInfo() (in the IPHLPAPI, if
available on your device), and select one to pass to the GetSignalStrength()
function.

You have two reasonable options: learn C/C++ and actually write your program
in that environment, or learn enough C/C++ to build a DLL which exports a
function to get the signal strength (or other information), for your eVB
program and call the DLL functions from your eVB program. I don't see much
going for eVB, anyway, so I'd suggest that switching to C is your best
long-term solution...

Paul T.

"mtz" <rmar...@hotpop.com> wrote in message

news:e2UKxT%23jDH...@TK2MSFTNGP10.phx.gbl...

0 new messages