I'm looking for example code for setting up a connection to a bluetooth device using the Bluetooth API in Cocoa. Apple used to include this type of example code in the XCode tools package under the /Developer/Examples/Bluetooth folder, but upon downloading the latest version of XCode (3.2.1), these bluetooth examples have been removed from that directory.
There is now a readme file located at /Developer/Examples/ReadMe.rtf that explains that all example code is on the ADC website. However, it seems that the ADC website does NOT include bluetooth sample code.
I've tried googling, but I can't seem to find any good examples for how to get bluetooth going on Mac OS X with Cocoa. Can anybody help me out? I wish I had copied those examples to a backup location before updating to XCode 3.2.1! Curses, Apple! Why have you taken them from me?
I recently went through my backups to look at this code and have posted it in case anyone wants to look at it.
http://cs.dal.ca/~mcormier/Bluetooth.zip
Please note that if you plan on working with Bluetooth for iOS devices then you want to use the Game Kit Peer-to-Peer Connectivity API and not this code.
Let Apple know you need these by filing a bug report (enhancement request) at https://bugreport.apple.com.
You can do what I've done: download an old copy of XCode and use Pacifist to extract what you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With