How to convert BD_ADDR to BT_ADDR?
-
Hi, In order to create a virtual COM port(for BlueTooth Comunication), I need the address of the BlueTooth device. I know the BD_ADDR,but i must convert it to BT_ADDR if i want to use the RegisterDevice() function. anyone? Regards, Eli
-
Hi, In order to create a virtual COM port(for BlueTooth Comunication), I need the address of the BlueTooth device. I know the BD_ADDR,but i must convert it to BT_ADDR if i want to use the RegisterDevice() function. anyone? Regards, Eli
First, you must know the bluetooth stack that your device has. RegisterDevice() is only supported by Microsoft Bluetooth stack. For example IPAQs uses Windcomm Stack and "RegisterDevice()" doesn't work. So if it's not microsoft Stack, you must buy the correct bluetooth Stack SDK for development. I made a virtual serial port without "RegisterDevice()" in my IPAQ. Simply uses the normal Open port, close port , read port and write port like it'was a normal serial port. I use the COM8 in my IPAQ hx4700 and it's works. When I open the port, appears a Window Dialog (made by the own Operative System) for choose the bluetooh device to connect. If you want to do this in your own app you must use a bluetooth Stack SDK for development in your device. Regards. Regards, Javier
-
First, you must know the bluetooth stack that your device has. RegisterDevice() is only supported by Microsoft Bluetooth stack. For example IPAQs uses Windcomm Stack and "RegisterDevice()" doesn't work. So if it's not microsoft Stack, you must buy the correct bluetooth Stack SDK for development. I made a virtual serial port without "RegisterDevice()" in my IPAQ. Simply uses the normal Open port, close port , read port and write port like it'was a normal serial port. I use the COM8 in my IPAQ hx4700 and it's works. When I open the port, appears a Window Dialog (made by the own Operative System) for choose the bluetooh device to connect. If you want to do this in your own app you must use a bluetooth Stack SDK for development in your device. Regards. Regards, Javier
Hi Javier, First,I really appriciate your detailed answer. just today i saw that iPaq uses the widcom stack and not the MS stack(is that the reason i can't use WSALookupServiceBrgin() etc.)? anyway,are you using COM8 for both incoming and outgoing massages(i use also the ipaq h2210 and it use COM5 for input and COM8 for output) Best regards,and thanx,again Eli
-
Hi Javier, First,I really appriciate your detailed answer. just today i saw that iPaq uses the widcom stack and not the MS stack(is that the reason i can't use WSALookupServiceBrgin() etc.)? anyway,are you using COM8 for both incoming and outgoing massages(i use also the ipaq h2210 and it use COM5 for input and COM8 for output) Best regards,and thanx,again Eli
If you have a IPAQ (uses windcom stack) then you cannot use RegisterDevice. About " WSALookupServiceBrgin()" I dont know, surely not, but you can ask in the microsoft Pocket PC 's developer: http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.pocketpc.developer[^] Yes, I use the COM8 for read and write. I saw the Bluetooth config and I saw COM5 for input too, but using COM8 both works. Simply try a sample serial com code (easy to find it, in this web there is something), using COM8 and it must work. If not, try another COM. Regards. Regards, Javier
-
If you have a IPAQ (uses windcom stack) then you cannot use RegisterDevice. About " WSALookupServiceBrgin()" I dont know, surely not, but you can ask in the microsoft Pocket PC 's developer: http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.pocketpc.developer[^] Yes, I use the COM8 for read and write. I saw the Bluetooth config and I saw COM5 for input too, but using COM8 both works. Simply try a sample serial com code (easy to find it, in this web there is something), using COM8 and it must work. If not, try another COM. Regards. Regards, Javier
Hi Javier, I tried to open COM8,but when i open this port,and choose the remote device, it automaticly create ActiveSync SerialPort connection(instead of generic serial connection). Here is my code: //============================================================================ bool PDA_BlueTooth::OutputPortOpening() { DWORD dwError; DCB PortDCB; COMMTIMEOUTS CommTimeouts; // Open the serial port. hOUTPUT = CreateFile(TEXT("COM8:"),GENERIC_READ | GENERIC_WRITE,0,NULL,CREATE_ALWAYS,0,NULL); // if it fails to open the port, return FALSE. if ( hOUTPUT == INVALID_HANDLE_VALUE ) { // Could not open the port. AfxMessageBox (TEXT("Unable to open BlueTooth Output Port!!!")); dwError = GetLastError (); return false; } ::SetupComm(hOUTPUT,4000, 2048); PortDCB.DCBlength = sizeof (DCB); // Get the default port setting information. GetCommState (hOUTPUT, &PortDCB); // Change the DCB structure settings. PortDCB.BaudRate = 115200; // Current CANgine Baudrate PortDCB.fBinary = TRUE; // Binary mode; no EOF check PortDCB.fParity = FALSE; // Disable parity checking PortDCB.fOutxCtsFlow = FALSE; // No CTS output flow control PortDCB.fOutxDsrFlow = FALSE; // No DSR output flow control PortDCB.fDtrControl = DTR_CONTROL_ENABLE; // DTR flow control type PortDCB.fDsrSensitivity = FALSE; // DSR sensitivity PortDCB.fTXContinueOnXoff = TRUE; // XOFF continues Tx PortDCB.fOutX = FALSE; // No XON/XOFF out flow control PortDCB.fInX = FALSE; // No XON/XOFF in flow control PortDCB.fErrorChar = FALSE; // Disable error replacement PortDCB.fNull = FALSE; // Disable null stripping PortDCB.fRtsControl = RTS_CONTROL_ENABLE; // RTS flow control PortDCB.fAbortOnError = FALSE; // Do not abort reads/writes on // error PortDCB.ByteSize = 8; // Number of bits/byte, 4-8 PortDCB.Parity = NOPARITY; // 0-4=no,odd,even,mark,space PortDCB.StopBits = ONESTOPBIT; // 0,1,2 = 1, 1.5, 2 // Configure the port according to the specifications of the DCB // structure. if (!SetCommState (hOUTPUT, &PortDCB)) { // Could not create the read thread. AfxMessageBox (TEXT("Unable to configure BlueTooth Out
-
Hi Javier, I tried to open COM8,but when i open this port,and choose the remote device, it automaticly create ActiveSync SerialPort connection(instead of generic serial connection). Here is my code: //============================================================================ bool PDA_BlueTooth::OutputPortOpening() { DWORD dwError; DCB PortDCB; COMMTIMEOUTS CommTimeouts; // Open the serial port. hOUTPUT = CreateFile(TEXT("COM8:"),GENERIC_READ | GENERIC_WRITE,0,NULL,CREATE_ALWAYS,0,NULL); // if it fails to open the port, return FALSE. if ( hOUTPUT == INVALID_HANDLE_VALUE ) { // Could not open the port. AfxMessageBox (TEXT("Unable to open BlueTooth Output Port!!!")); dwError = GetLastError (); return false; } ::SetupComm(hOUTPUT,4000, 2048); PortDCB.DCBlength = sizeof (DCB); // Get the default port setting information. GetCommState (hOUTPUT, &PortDCB); // Change the DCB structure settings. PortDCB.BaudRate = 115200; // Current CANgine Baudrate PortDCB.fBinary = TRUE; // Binary mode; no EOF check PortDCB.fParity = FALSE; // Disable parity checking PortDCB.fOutxCtsFlow = FALSE; // No CTS output flow control PortDCB.fOutxDsrFlow = FALSE; // No DSR output flow control PortDCB.fDtrControl = DTR_CONTROL_ENABLE; // DTR flow control type PortDCB.fDsrSensitivity = FALSE; // DSR sensitivity PortDCB.fTXContinueOnXoff = TRUE; // XOFF continues Tx PortDCB.fOutX = FALSE; // No XON/XOFF out flow control PortDCB.fInX = FALSE; // No XON/XOFF in flow control PortDCB.fErrorChar = FALSE; // Disable error replacement PortDCB.fNull = FALSE; // Disable null stripping PortDCB.fRtsControl = RTS_CONTROL_ENABLE; // RTS flow control PortDCB.fAbortOnError = FALSE; // Do not abort reads/writes on // error PortDCB.ByteSize = 8; // Number of bits/byte, 4-8 PortDCB.Parity = NOPARITY; // 0-4=no,odd,even,mark,space PortDCB.StopBits = ONESTOPBIT; // 0,1,2 = 1, 1.5, 2 // Configure the port according to the specifications of the DCB // structure. if (!SetCommState (hOUTPUT, &PortDCB)) { // Could not create the read thread. AfxMessageBox (TEXT("Unable to configure BlueTooth Out
Hi, i want to develop application using eVC++ 4.0 for windows ce 5.0 device. Actually, i want to get the phoone book data(such as call hsitory list, outgoing, received calls, missed calls, address book, sms message list ) from nokia phone to my pocket pc over bluetooh conenction. i am refering http://www.palowireless.com/infotooth/tutorial.asp for BT developement. i am able to establish BT connection between two BT devices successfully. what profile do i need to use for this task ? do i need to use AT command over serial profile, or object push profile or syncML or IrMC standard ? please do let me know if you have any idea about it. please suggest me in detail. regards, aks