Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bluetooth pairing without passkey

I am going to develope a application in VC++ for bluetooth communication.My aim is to pair two bluetooth devices without the passkey communication.For my application am using the BluetoothAPI. Anybody can help me to complete my task by providing the code?


1 Answers

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; }

Use a key common to both PC and device in place of strDevicePassKey.

like image 185
JiTHiN Avatar answered Jun 10 '26 08:06

JiTHiN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!