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

📄 devicemanager.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 DeviceManager class   Author: Zsolt Molnar (Zsolt.Molnar@ieee.org)   ---------------------------------------------------------------------------*/#include <iostream>#include "base.hh"#include "AppFactory.hh"#include "ICommInitiator.hh"#include "INetHandler.hh"#include "DeviceManager.hh"namespace { 	const char rcs_id[] = "$Id$"; }void DeviceManager::addDevice(const Device& aDevice){	pthread_t tid;	// this is to be deleted by the thread...	Device* dev = new Device(aDevice);	pthread_create(&tid, NULL, &DeviceManager__addDevice_thr, 				   static_cast<void*>(dev));}voidDeviceManager::removeDevice(const Device& aDevice){	AppFactory::getNetHandler().unconnect(aDevice);}void* DeviceManager__addDevice_thr(void* aDevice){	Device* dev = static_cast<Device*>(aDevice);	// Connect those devices that report successfull initialization	if (AppFactory::getCommInitiator().perform(*dev)) {		AppFactory::getNetHandler().connect(*dev);	}	delete dev;}#ifdef __TEST__#include <assert.h>#include <iostream>#define TEST_DNH_TRUE 1#define TEST_DNH_FALSE 2boolDeviceManager::test(){		cout << "DeviceManager test passed" << endl;	return true;}#endif // #ifdef __TEST__

⌨️ 快捷键说明

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