57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
#pragma once
|
|
|
|
// Link to Bthprops.lib
|
|
#include <iostream>
|
|
#include <BluetoothAPIs.h>
|
|
|
|
#include <list>
|
|
#include <map>
|
|
#include <algorithm>
|
|
|
|
#pragma comment(lib, "Bthprops.lib")
|
|
|
|
#include "BluetoothSockets.h"
|
|
|
|
#include "BluetoothRadioManager.h"
|
|
|
|
// CBluetoothDeviceManager
|
|
|
|
class CBluetoothRadioManager;
|
|
|
|
class CBluetoothDeviceManager
|
|
{
|
|
public:
|
|
CBluetoothDeviceManager(const CBluetoothRadioManager &rCBluetoothRadioManager, BLUETOOTH_DEVICE_INFO_STRUCT &rBLUETOOTH_DEVICE_INFO_STRUCT);
|
|
virtual ~CBluetoothDeviceManager();
|
|
|
|
private:
|
|
friend class CBluetoothRadioManager;
|
|
|
|
CBluetoothSocket m_Socket;
|
|
|
|
BLUETOOTH_DEVICE_INFO_STRUCT m_BLUETOOTH_DEVICE_INFO_STRUCT;
|
|
|
|
const CBluetoothRadioManager &m_rCBluetoothRadioManager;
|
|
|
|
HBLUETOOTH_AUTHENTICATION_REGISTRATION m_hHBLUETOOTH_AUTHENTICATION_REGISTRATION;
|
|
|
|
protected:
|
|
|
|
public:
|
|
BLUETOOTH_ADDRESS GetAddress(void);
|
|
LPCTSTR GetName(void);
|
|
ULONG GetClassofDevice(void);
|
|
|
|
void SendPairing(void);
|
|
void StartPairing(void);
|
|
BOOL SocketAttach(SOCKET s);
|
|
BOOL Attach(const BTH_DEVICE_INFO &pDeviceInfo);
|
|
|
|
BOOL Connect(void);
|
|
void Close(void);
|
|
|
|
int Send(LPVOID pVoid, UINT dLength);
|
|
};
|
|
|
|
BOOL WINAPI auth_callback_ex(LPVOID pvParam, PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS authParams);
|