⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hardcodeddevicetypeextractor.cpp

📁 It s a tool designed to extract as much information as possible from Bluetooth devices without the r
💻 CPP
字号:
/* -*- c++ -*- ---------------------------------------------------------------   Copyright (C) 2005, SWECO, All Rights Reserved.   Implementation of HardcodedDeviceTypeExtractor class   Author: Zsolt Molnar (Zsolt.Molnar@ieee.org)   ---------------------------------------------------------------------------*/#include "HardcodedDeviceTypeExtractor.hh"namespace { 	const char rcs_id[] = "$Id$"; }HardcodedDeviceTypeExtractor::_tDevTypeMap     HardcodedDeviceTypeExtractor::_devTypeMap;bool HardcodedDeviceTypeExtractor::_devTypeMap_isReady = false;HardcodedDeviceTypeExtractor::HardcodedDeviceTypeExtractor(){	if (!_devTypeMap_isReady) {		_fillDevTypeMap();	}}Device::tDeviceType HardcodedDeviceTypeExtractor::getDeviceType(const string& aDevClassID){	_tDevTypeMap::iterator pos = _devTypeMap.find(aDevClassID);	return pos == _devTypeMap.end() ? Device::OTHER : pos->second.type;}void HardcodedDeviceTypeExtractor::_fillDevTypeMap(){	_devTypeMap["0x500204"].type = Device::NOKIA6600;	_devTypeMap["0x500204"].OBEXChannel = 9;	_devTypeMap["0x50020c"].type = Device::NOKIA7610;	_devTypeMap["0x50020c"].OBEXChannel = 9;}Device::tOBEXChannel HardcodedDeviceTypeExtractor::getOBEXChannel(const string& aDevClassID){	_tDevTypeMap::iterator pos = _devTypeMap.find(aDevClassID);	return pos == _devTypeMap.end() ? -1 : pos->second.OBEXChannel;}#ifdef __TEST__#include <assert.h>#include <iostream>bool HardcodedDeviceTypeExtractor::test(){	HardcodedDeviceTypeExtractor hdte;	assert(hdte.getDeviceType("0x300104") == Device::OTHER);	assert(hdte.getDeviceType("0x500204") == Device::NOKIA6600);	cout << "HardcodedDeviceTypeExtractor test passed" << endl;	return true;}#endif // #ifdef __TEST__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -