2012-07-02 5 views
3

나는 블루투스 통신을위한 VC + +에서 응용 프로그램을 개발할 예정이다. 내 목표는 블루투스 장치없이 두 개의 블루투스 장치를 쌍으로하는 것입니다. 내 응용 프로그램은 BluetoothAPI를 사용하고 있습니다. 누구든지 코드를 제공하여 내 작업을 완료하는 데 도움을 줄 수 있습니까?블루투스 페어링 패스 키없이

+0

(http://whathaveyoutried.com) 나는이 블루투스 1. PC 동글과 같은 2. 마우스 블루투스 장치가 정상 설치에 우리 고토 제어판을 확인하고 추가하려면이 – Mizipzor

+0

이 장치는 시스템에 직접 추가되고 키를 사용하지 않고 서로 쌍을 이룹니다. 나는 운영 체제에서 장치를 시스템에 삽입하여 내 exe, dll을 시작할 수 있도록 이벤트를 가져 와서 자동화하려고합니다. 제어판 창을 표시하지 않고 장치를 설치하겠습니까? 어떻게이 작업을 수행 할 수 있습니까? –

답변

1
string BTMac = "00:01:58:08:3D:ED"; 

BluetoothAddress BTAddress; 

BluetoothClient BTClient = new BluetoothClient(); 

BluetoothEndPoint BTEndPoint; 

Guid spguid = BluetoothService.SerialPort; 

BTAddress = BluetoothAddress.Parse(BTMac); 

BTEndPoint = new BluetoothEndPoint(BTAddress, spguid); 

try 

{ 

BluetoothSecurity.PairRequest(BTAddress, strDevicePassKey); 

Application.DoEvents(); 

BTClient = new BluetoothClient(); 

BTClient.Connect(BTEndPoint); 

return true; 

} 

catch { return false; } 

strDevicePassKey 대신 PC와 장치에 공통된 키를 사용하십시오. [당신이 시도 무엇?]

관련 문제