1

I'm trying to use a Bluetooth OBDII (on-board diagnosis) to connect with a Bluetooth dongle connected to my computer (My OS is windows 7). The dongle connects to the device and assigns it 2 virtual com ports (COM4 for incoming and COM5 for outgoing), But unfortunately I couldn't communicate with this device over the virtual com port. I also attempted to work with winsock library but I didn't find any example for working with Bluetooth OBD and send and receive the instruments. I just found one Bluetooth API for android but it's not useful for me because I want to implement it inside the visual C++ and for PC. and right now I have 2 questions about that : 1. which method is better, Virtual com port or winsock and how ? 2. Do you have any sample code for working with Bluetooth OBD ?

manuell
  • 7,528
  • 5
  • 31
  • 58
Amin Abouee
  • 41
  • 2
  • 5

1 Answers1

0

1: Has your device a ELM327 chip? If so, you can setup a serial port over bluetooth, and communicate with that port. I don't know winsock very much, but I think a serial port is better suited for this job. To set it up, have a look here: http://windows.microsoft.com/en-us/windows7/choose-a-com-port-for-a-bluetooth-enabled-device Maybe if you can pair with the device, windows 7 will automagically set it up?

2: You might want to have a look at: http://icculus.org/obdgpslogger/

It's open-source, so you can have a peek how it works. There's also a simulator in the package, which could help you developing/testing. Mostly is Linux based, but it should give you hints where to go. There are also windows installers available for the simulator.

Eric Smekens
  • 1,602
  • 20
  • 32
  • My device is ELM327 and win 7 automatically create 2 virtual COM port for Bluetooth but my application, couldn't talk to the device over the virtual com port. I saw the obdsim and I worked with it and com0com, when I create 2 com port (CNCA0 and CNCB0) with com0com, every things works great and my application can receive data, but when I use a virtual com port (for example COM7) as the Bluetooth com port, my app couldn't sense it !! as the matter of fact, the problem returns to Bluetooth over com port and I couldn't receive any data with that. – Amin Abouee Mar 07 '13 at 13:10
  • What kind of error do you get? Or what doesn't work? Are you able to connect? – Eric Smekens Mar 07 '13 at 15:34