资源简介
ZigBee Sensor Monitor 源代码
![](http://www.nz998.com/pic/44268.jpg)
代码片段和文件信息
//***********************************************************************************
//* ****
//* ****
//* ******o****
//* ********_///_**** TEXAS INSTRUMENTS
//* ******/_//_/*****
//* ** ***(_/***** ComPort.cpp
//* *********
//* *****
//* ***
//*
//* Copyright (C) 2007-2009 Texas Instruments. All rights reserved.
//*
//* This file may be used under the terms of the GNU General Public
//* License version 2.0 as published by the Free Software Foundation
//* and appearing in the file “GNU GENERAL PUBLIC LICENSE.txt“ included in the
//* packaging of this file.
//*
//* This file is provided AS IS with NO WARRANTY OF ANY KIND INCLUDING THE
//* WARRANTY OF DESIGN MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//***********************************************************************************
//* Compiler: MSVC++ 2005/2008 Express
//* Target platform: Windows+QT
//***********************************************************************************
#include
#define _WIN32_DCOM
#include
using namespace std;
#include
#pragma comment(lib “WbemUuid.Lib“)
#include
#include
#include
#include “comport.h“
// Definition of the functions in setupapi.dll
typedef HKEY (__stdcall SETUPDIOPENDEVREGKEY)(HDEVINFO PSP_DEVINFO_DATA DWORD DWORD DWORD REGSAM);
typedef BOOL (__stdcall SETUPDIDESTROYDEVICEINFOLIST)(HDEVINFO);
typedef BOOL (__stdcall SETUPDIENUMDEVICEINFO)(HDEVINFO DWORD PSP_DEVINFO_DATA);
typedef HDEVINFO (__stdcall SETUPDIGETCLASSDEVS)(LPGUID LPCTSTR HWND DWORD);
typedef BOOL (__stdcall SETUPDIGETDEVICEREGISTRYPROPERTY)(HDEVINFO PSP_DEVINFO_DATA DWORD PDWORD PBYTE DWORD PDWORD);
DEFINE_GUID(GUID_DEVINTERFACE_COMPORT 0x86E0D1E0L 0x8089
0x11D0 0x9C 0xE4 0x08 0x00 0x3E 0x30 0x1F 0x73);
/** \brief Constructor
*
*/
ComPort::ComPort(Qobject *pParent)
{
//Initialize COM (Required by WMI)
CoInitialize(NULL);
HRESULT hr = CoInitializeSecurity(NULL -1 NULL NULL RPC_C_AUTHN_LEVEL_DEFAULT/*PKT_INTEGRITY*/ RPC_C_IMP_LEVEL_IMPERSONATE NULL 0 NULL);
if (FAILED(hr) )
{
CoUninitialize();
}
connect(&comPortThread SIGNAL(packetReady()) pParent SLOT(handlePacket()));
}
//-----------------------------------------------------------------------------
/** \brief Enumeration of COM port
*
* The enumeration of the serial COM port is executed with two methods:
* 1. With the use of the setupapi.dll library.
* 2. With the use of the Window Management Instrumentation (WMI)
*
* If both metods fails this function will return an error.
*/
//-----------------------------------------------------------------------------
int ComPort::Enum(QStringList &portList)
{
int result = CP_ERROR;
printf(“Start enumeration of serial port\n“);
result = EnumSetupapi(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17925 2010-02-11 13:23 comport.cpp
文件 2055 2010-02-11 13:23 comport.h
文件 1799 2010-02-11 13:23 comportcombo.cpp
文件 1481 2010-02-11 13:23 comportcombo.h
文件 14187 2010-02-11 13:23 comportthread.cpp
文件 3515 2010-02-11 13:23 comportthread.h
文件 3508 2010-02-11 13:23 edge.cpp
文件 1756 2010-02-11 13:23 edge.h
文件 315 2010-02-11 13:23 enumport.cpp
文件 251 2010-02-11 13:23 enumport.h
文件 16296 2010-02-11 13:22 GNU GENERAL PUBLIC LICENSE.txt
目录 0 2010-03-18 22:32 images\
文件 14161 2010-02-11 13:22 images\ButtonAbout.png
文件 14176 2010-02-11 13:22 images\ButtonConnected.png
文件 10978 2010-02-11 13:22 images\ButtonDisconnected.png
文件 12225 2010-02-11 13:22 images\Button
文件 10960 2010-02-11 13:22 images\ButtonNew.png
文件 11136 2010-02-11 13:22 images\ButtonPause.png
文件 11310 2010-02-11 13:22 images\ButtonPlay.png
文件 14856 2010-02-11 13:22 images\ButtonPlayGreen.png
文件 14472 2010-02-11 13:22 images\ButtonRefresh.png
文件 15276 2010-02-11 13:22 images\ButtonSettingsBlue.png
文件 9851 2010-02-11 13:22 images\Button
文件 44422 2010-02-11 13:22 images\chip_2.png
文件 1771 2010-02-11 13:22 images\fileopen.png
文件 1022 2010-02-11 13:22 images\filesave.png
文件 3638 2010-02-11 13:22 images\ti.ico
文件 18000 2010-02-11 13:22 images\ti_banner.png
文件 4181 2010-02-11 13:22 images\ti_logo_red.png
文件 8061 2010-02-11 13:23 iohandler.cpp
文件 3101 2010-02-11 13:23 iohandler.h
............此处省略27个文件信息
- 上一篇:《计算机科学技术导论》陶树平
- 下一篇:1.7万条中文同义词词库
相关资源
- IAR7.20H破解机注册机
- cc2530寄存器手册
- VESA Computer Display Monitor Timing (DMT)
- 文件监视器file monitor
- 课程设计蔬菜大棚自动控制系统,包
- 基于PIC的TCP/IP网络协议和zigbee无线传
- 基于Zigbee的土壤墒情监控系统设计
- labview process monitor控件
- free-serial-port-monitor_(串口监控调试)
- 基于ZigBee的温室花房环境监测系统设
- 基于ZigBee温室环境监测系统电路设计
- 基于ZigBee和ARM技术的森林火情监测系
- 基于ZigBee的温湿度监控系统设计
- 基于ZigBee技术的智能家居无线网络系
- 基于PLC、GPRS以及ZigBee的路灯无线控制
- 基于ZigBee无线传感网络的托辊卡死故
- 基于ZigBee无线传感器网络的井下环境
- 基于ZigBee无线网络的气体监测报警系
- 基于ZigBee和GIS的井下人员定位系统的
- 基于ZigBee的车间环境监测系统的设计
- 基于ZigBee技术的矿井智能头盔
- 无线传感网络在瓦斯智能监控系统的
- 基于ZigBee的智能瓦斯报警矿灯设计
- 基于CAN总线与ZigBee的瓦斯实时监测及
- 基于ZigBee技术的井下无线瓦斯传感器
- 智能分户供暖监控系统的无线温控器
- 基于ZigBee技术的无线点餐系统设计
- 基于Zigbee和GPRS的无线温湿度测量系统
- 基于Zigbee无线通信的井下人员定位系
- 基于ZigBee的工业无线数据采集器设计
评论
共有 条评论