Bluetooth on OSX

P

Peter Burns

------=_Part_10039_2144422.1133243450842
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I'm looking to automate transferring pics from a cellphone via bluetooth on
OS X. Any suggestions on where to start with this project? Ruby is the
natural language for this, not just because I love it so dearly, but becaus=
e
I hope to integrate this with a Rails photo gallery app.

My google-fu is failing me on relevant libraries, ruby or otherwise.

------=_Part_10039_2144422.1133243450842--
 
G

Gregory Brown

I'm looking to automate transferring pics from a cellphone via bluetooth = on
OS X. Any suggestions on where to start with this project? Ruby is the
natural language for this, not just because I love it so dearly, but beca= use
I hope to integrate this with a Rails photo gallery app.

My google-fu is failing me on relevant libraries, ruby or otherwise.

I have no experience in this area at all, but i remember seeing a
cellphone bluetooth XMMS remote control program on RAA, so I looked it
up for you:

http://linuxbrit.co.uk/bluexmms/

You might be able to tear the protocol stuff out of there and modify it. H=
TH
 
R

Reinder Verlinde

Peter Burns said:
I'm looking to automate transferring pics from a cellphone via bluetooth on
OS X. Any suggestions on where to start with this project? Ruby is the
natural language for this, not just because I love it so dearly, but because
I hope to integrate this with a Rails photo gallery app.

My google-fu is failing me on relevant libraries, ruby or otherwise.

gnokii (www.gnokii.org) works for me from the command line. A simple
ryby script around it is:

info = `gnokii --monitor once`

numUnreadSMSes = 0
numSMSes = 0

info.scan( /^SMS Messages: Unread ([0-9]+), Number ([0-9]+)/) { |x,y|
numUnreadSMSes = x
numSMSes = y
}

puts numUnreadSMSes
puts numSMSes

Aside: I may not be possible at all to transfer pictures from your phone
over Bluetooth. Mobile operators would rather have you use MMS to mail
them to yourself.

Reinder
 
I

i.script

A simple way to do it is using RubyCocoa. RubyCocoa offers two
solutions. Either through the usage of its AppleScript bridge. With
embedded AppleScript it becomes possible to control the application
"Bluetooth File Exchanger" inside the "Utilities" folder.

..or you use native cocoa classes inside your Ruby code. This approach
requires some knowledge about OBEX. Have a look into the application
OBEXSample inside /Developer/Examples/Bluetooth !

Finally it will look similar to this

-----------------------------------------------------
require 'osx/cocoa'

OSX::NSBundle.bundleWithPath("/System/Library/Frameworks/IOBluetoothUI.framework").load
OSX.ns_import :IOBluetoothDeviceSelectorController



bluedevices = OSX::IOBluetoothDeviceSelectorController.deviceSelector
bluedevices.runModal
blue_data = bluedevices.getResults
puts blue_data
 
P

Peter Burns

Thanks for the two wonderful replies, this just turned a wishful
thinking project into something that I could have working in a couple
hours.

I can use the Bluetooth File Exchange app to grab pictures off of my
mobile (that was definitely something I was looking for in a phone; I
wasn't going to pay a dollar a piece for the privilege of emailing
myself my own pictures), so I'm confident that if I can't wrangle
gnokil to access the pics, I'll be able to by talking to the Bluetooth
File Exchange app.

I'll post the code here once I get it working and perhaps it will help
someone else along.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,197
Messages
2,571,041
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top