资源简介
ZigBee Sensor Monitor 源代码
代码片段和文件信息
//***********************************************************************************
//* ****
//* ****
//* ******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万条中文同义词词库
相关资源
- 共五章第四章:Zigbee基础实验详解.
- 一种基于Zigbee技术的智慧教室管理系
- Zigbee模块封装库文件
- 5G,NB-IoT,WiFi,LoRa,BLE,Zigbee等市场
- 基于Zigbee协议栈的DHT11串口实验
- 基于ZigBee技术的温度采集系统设计毕
- ZigBee和单总线在冻结井壁无线测温系
- DB2数据库管理软件 - db2mon v1.0
- 基于ZigBee和STM32的室内智能照明系统的
- 基于Zynq平台的动态智能家居系统的设
- 基于单片机的Zigbee传感器节点硬件设
- Zigbee Cluster Library Specification 2018最新
- 驱动加载工具DriverMonitor
- ehcache-monitor-kit-1.0.3
- The Exploration of Applications of InSAR/GPS I
- 基于Zigbee的低功耗无线顶板压力监测
- ZigBee HA 1.2
- ZigBee CC2530视频教程
- Webbrowser调用dll简单方便获取request r
- IEEE std 802.15.4-2015
- cc debugger 32位 64位
- 视频显示时序标准VGA、HDMI, VESA-Mon
- Serial Monitor V6.02 破解版
- 绿色简单实用的串口监听工具SerialP
- zigbee_Z-Stack 3.0 开发者中文手册.pdf
- NXP ZigBee 3.0协议栈用户手册全中文JN
- PRTG Network Monitor 13 破解工具
- zigbee无线传感器网络设计与实现(源
- 基于CC2530 及ZigBee 协议栈设计无线网络
- 基于ZigBee和ARM的嵌入式智能家庭安防
评论
共有 条评论