Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bluetooth Example Code for Cocoa (Objective-C)

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?

like image 703
Stuart Berg Avatar asked Oct 22 '09 04:10

Stuart Berg


3 Answers

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.

like image 90
Matthieu Cormier Avatar answered Nov 16 '22 11:11

Matthieu Cormier


Let Apple know you need these by filing a bug report (enhancement request) at https://bugreport.apple.com.

like image 21
geowar Avatar answered Nov 16 '22 11:11

geowar


You can do what I've done: download an old copy of XCode and use Pacifist to extract what you need.

like image 2
outis Avatar answered Nov 16 '22 10:11

outis