Hi,
The last few days, I received several questions related to the status of native bluetooth communication. In order to avoid having to repeat myself, let's give a small overview of the current status.
A while ago, I have been prototyping a native bluetooth communication backend for libdivecomputer. The goal is to be able to replace the serial emulation in the future. The main reason behind this effort is that the current situation, where we rely on serial emulation, is less than ideal. It requires some setup by the end-user, and last but not least it doesn't appear to work very well on linux!
I have arrived at a point where I have a functional implementation for windows and linux. With functional, I mean I'm able to connect to the dive computer and successfully download dives. What is still missing is device discovery, which means you have to figure out the bluetooth address of the device manually. Certainly not perfect yet, but it does work!
I have attached the patches with my prototype code. These patches include the bluetooth communication code, together with the necessary changes to integrate it into the Shearwater Predator/Petrel backend (the same could be done for the Heinrichs Weikamp Frog too).
The linux and windows implementations are very similar because they both provide a socket interface [1,2]. (I actually spend most of the time debugging a failure on Windows. In the end, the problem turned out to be caused by a bug in the mingw header files, and not my code. The bug was already fixed upstream [3], but not yet included in the packages I was using.)
I'm now looking at Mac OS X support, but this appears to be much harder than I expected. The developer documentation [4] isn't very helpful. It contains lots of information, but appears to lack the info I'm looking after (e.g. how to connect to a device, send/receive data, etc). The fact that I don't have any experience with Objective-C code or the Mac framework doesn't really help either. So if anyone can provide some assistance here, that would be great! Ideally, I would like to avoid using Objective-C code completely and use the C api of the Mac framework instead.
Of course help is not limited to the Mac OS X part only. If you have some knowledge about bluetooth in general, or have some experience with the Windows/Linux bluetooth api's, then any help in that area is appreciated too!
[1] http://people.csail.mit.edu/albert/bluez-intro/ [2] http://msdn.microsoft.com/en-us/library/windows/desktop/aa362932%28v=vs.85%2... [3] http://sourceforge.net/p/mingw-w64/code/6249/ [4] https://developer.apple.com/library/mac/#documentation/DeviceDrivers/Concept...
Jef
I'm now looking at Mac OS X support, but this appears to be much harder than I expected. The developer documentation [4] isn't very helpful. It contains lots of information, but appears to lack the info I'm looking after (e.g. how to connect to a device, send/receive data, etc). The fact that I don't have any experience with Objective-C code or the Mac framework doesn't really help either. So if anyone can provide some assistance here, that would be great! Ideally, I would like to avoid using Objective-C code completely and use the C api of the Mac framework instead.
Thank you for your work with this Jef. I have reached out to a group of developers I know to see if anyone has experience with bluetooth communication.