资源简介
比较实用的室内定位算法代码。有详细说明.
代码片段和文件信息
/*
List 802.3 adapters (WiFi) for Windows system with NDIS protocol.
It requiered a fresh install of a NDISPROT miniport driver. Tested with Windows XP SP2 only.
Should be adapted for windows XP SP1 (NDISPROT => NDISUIO).
To install NDISPROT miniport driver
1) Open your network properties and choose install->protocol choose “I have a disk...“
2) Select from “ndisprotminidriver“ dir and select ndisprot.inf
Usage
------
y = wifidevice;
IMPORTANT
---------
Don‘t forget to start NDISPROT service by the following command from Matlab :
!net start ndisprot
Don‘t forget also to shutdown NDISPROT service by the following command from Matlab :
!net stop ndisprot
Compilation
-----------
mex -output wifidevice.dll wifidevice.c
Example
------
device = wifidevice;
device{1} = ‘\DEVICE\{F73677B9-E158-46BF-8342-91BD6B794D75}‘
Author : S閎astien PARIS ?(sebastien.paris@lsis.org)
-------
*/
#pragma warning(disable:4201) // nameless struct/union
#pragma warning(disable:4127) // conditional expression is constant
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “ntddndis.h“
#include “nuiouser.h“
#ifndef NDIS_STATUS
#define NDIS_STATUS ULONG
#endif
#if DBG
#define DEBUGP(stmt) printf stmt
#else
#define DEBUGP(stmt)
#endif
#define PRINTF(stmt) printf stmt
#ifndef MAC_ADDR_LEN
#define MAC_ADDR_LEN 6
#endif
#define MAX_NDIS_DEVICE_NAME_LEN 256
CHAR NdisProtDevice[] = “\\\\.\\\\NdisProt“;
CHAR * pNdisProtDevice = &NdisProtDevice[0];
BOOLEAN DoEnumerate = FALSE;
BOOLEAN DoReads = FALSE;
INT NumberOfPackets = -1;
ULONG PacketLength = 100;
UCHAR SrcMacAddr[MAC_ADDR_LEN];
UCHAR DstMacAddr[MAC_ADDR_LEN];
BOOLEAN bDstMacSpecified = FALSE;
CHAR * pNdisDeviceName = “JUNK“;
USHORT EthType = 0x8e88;
BOOLEAN bUseFakeAddress = FALSE;
UCHAR FakeSrcMacAddr[MAC_ADDR_LEN] = {0};
HANDLE OpenHandle(CHAR *pDeviceName)
{
DWORD DesiredAccess;
DWORD ShareMode;
LPSECURITY_ATTRIBUTES lpSecurityAttributes = NULL;
DWORD CreationDistribution;
DWORD FlagsAndAttributes;
HANDLE TemplateFile;
HANDLE Handle;
DWORD BytesReturned;
DesiredAccess = GENERIC_READ|GENERIC_WRITE;
ShareMode = 0;
CreationDistribution = OPEN_EXISTING;
FlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
TemplateFile = (HANDLE)INVALID_HANDLE_VALUE;
Handle = CreateFile(pDeviceName DesiredAccess ShareMode lpSecurityAttributes CreationDistribution Flags
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1580 2009-05-18 17:03 license.txt
目录 0 2007-08-01 13:53 ndisprotminidriver\
文件 2661 2005-02-18 12:31 ndisprotminidriver\ndisprot.inf
文件 21376 2006-03-27 22:58 ndisprotminidriver\ndisprot.sys
文件 120057 2006-03-28 01:00 ntddndis.h
文件 3247 2005-02-18 12:31 nuiouser.h
文件 9909 2008-07-10 18:33 wifiRSSI.c
文件 28742 2006-03-30 22:36 wifiRSSI.dll
文件 5995 2008-07-10 18:33 wifidevice.c
文件 28744 2006-03-28 22:21 wifidevice.dll
- 上一篇:基于SSH的汽车租赁系统
- 下一篇:一种基于WiFi的室内定位系统设计与实现
评论
共有 条评论