Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am having a HP laptop (Probook 6470b) with Windows 7 configuration and BroadCom stack (Driver Version : 6.5.1.1785).

Windows CreateFile() API fails with error code 1397 or 1238 while trying to connect a device via serial COM port over Bluetooth.

I am having an administrator account and antivirus has not been installed over laptop, all the data transfer happens through Bluetooth only.

Application receives valid COM port still problem occurs.


Following is the code snipet :

BluetoothFindFirstRadio(&m_bt_find_radio,&m_radio);
.
.
BluetoothAuthenticateDevice(
NULL,
m_radio,
&m_device_info,
L"PASSKEY",
SEVEN
);

.
.
//m_device_info.Address contains the BT address in the format "AA:BB:CC:DD:EE:FF"
.

BluetoothSetServiceState(
NULL,
&m_device_info,
&SerialPortServiceClass_UUID,
BLUETOOTH_SERVICE_ENABLE
);
If authentication fails then tried retry for 3 times.
.
/* Logic has been implemented to find the com port created by BluetoothSetServiceState(. .. ) api. * /
.

CreateFileA (
(LPCSTR)szComPortStr,
GENERIC_READ | GENERIC_WRITE,
NULL,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL );

szComPortStr is having the format : " \\\\.\\%s" where %s specifies the port number.
If CreateFileA() fails then tried retry for 3 times.



Request you to plz help me. . .. .



Regards,
Nilam.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900