tags:

views:

186

answers:

2

Hi all, I'm trying to get a list of the bluetooth addresses (the MAC address-like hex digits unique to each bluetooth device) within range of the bluetooth device inside my mac in the ruby language.

I'm hoping to make my work publicly available, so it'd be nice if it was platform agnostic.

Googling only helps so much:

  • hcitool etc aren't available on OS X: snippets.dzone (dot) com/posts/show/5764
  • Ruby_Bluetooth is nearly 4 years old, and I can't make it work!: rubyforge (dot) org/projects/ruby-bluetooth/
  • Herval is attempting to continue that project, but the git repo is only a day old… github (dot) com/herval/ruby-bluetooth

I don't need to create any services or interact with bluetooth in any extensive way, only list the device ids that are within range.

Does anyone have any other ideas? (Even for non ruby, platform specific hcitool equivalents?)

A: 

You could go the non-platform specific route and use the native frameworks instead.

For example

There are other options for other platforms, such as Ruby and Win32OLE/COM.

Scott Markwell
Cheers man, my objective C is completely non-existant so I may not be able to get this working, but there's only one way of finding out!
JP
+1  A: 

Have you thought about leveraging a Java Bluetooth API and using it from JRuby?

This might make it easier to create platform agnostic code.

For instance bluecove looks like it would cover all the major platforms.

A nice cross platform option. Would require packaging JNI binary packages for each platform, but depending on your needs this could be easily done.
Scott Markwell
Its another venture into a language I'm not familar with :P But I think this will be the way to go in the meanwhile - does seem a little like overkill tho!
JP