Intermec 700 Series User Manual page 118

Color mobile computer
Hide thumbs Also See for 700 Series:
Table of Contents

Advertisement

SECTION 4
Network Selection APIs
The Network Selection APIs allow the user to change network adapter configura-
tion programmatically. Both drivers support the same IOCTL function numbers
for loading and unloading the drivers.
Loading and unloading of the 802.11b driver is performed by the FWV1: device
in the system by performing DeviceIOControl() calls to the driver.
Loading and unloading of the driver for the built-in Ethernet adapter is per-
formed by the SYI1: device in the system by performing DeviceIOControl() calls
to the driver.
EXAMPLE:
#include <winioctl.h>
#include "sysio.h"
void DoLoad(int nDevice) {
LPTSTR devs[] = { _T("SYI1:"), _T("FWV1:") };
HANDLE hLoaderDev;
DWORD bytesReturned;
hLoaderDev = CreateFile(devs[nDevice], GENERIC_READ|GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, 0, NULL);
if (hLoaderDev != INVALID_HANDLE_VALUE) {
}
}
void DoUnload(int nDevice) {
LPTSTR devs[] = { _T("SYI1:"), _T("FWV1:") };
HANDLE hLoaderDev;
DWORD bytesReturned;
hLoaderDev = CreateFile(devs[nDevice], GENERIC_READ|GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, 0, NULL);
if (hLoaderDev != INVALID_HANDLE_VALUE) {
}
}
For loading an NDIS driver associated with an adapter, the IOCTL is
IOCTL_LOAD_NDIS_MINIPORT.
For unloading NDIS drivers associated with an adapter the IOCTL is
IOCTL_UNLOAD_NDIS_MINIPORT.
if (!DeviceIoControl( hLoaderDev, IOCTL_LOAD_NDIS_MINIPORT, NULL, -1, NULL, 0,
&bytesReturned, NULL)){
MessageBox(NULL, TEXT("SYSIO IoControl Failed"), TEXT("Network
loader"),MB_ICONHAND);
if (hLoaderDev!=INVALID_HANDLE_VALUE) CloseHandle(hLoaderDev);
hLoaderDev = INVALID_HANDLE_VALUE; // bad handle
}else {
CloseHandle(hLoaderDev);
}
if (!DeviceIoControl( hLoaderDev, IOCTL_UNLOAD_NDIS_MINIPORT, NULL, -1, NULL, 0,
&bytesReturned, NULL)){
MessageBox(NULL, TEXT("SYSIO IoControl Failed"),TEXT("Network
loader"),MB_ICONHAND);
if (hLoaderDev!=INVALID_HANDLE_VALUE) CloseHandle(hLoaderDev);
hLoaderDev = INVALID_HANDLE_VALUE; // bad handle
}else {
CloseHandle(hLoaderDev);
}
700 Series Color Mobile Computer User's Manual
Network Support
4-41

Advertisement

Table of Contents
loading

Table of Contents