Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 19, 2005, 02:39 PM   #1
Gizmotoy
macrumors 6502a
 
Gizmotoy's Avatar
 
Join Date: Nov 2003
BlueTooth Help

Hello,

I was just wondering if anyone here has any experience with programming BlueTooth devices within XCode. Basically, I'm trying to set up the device as a RFCOMM serial port which data can be sent over. I only need a relatively simple text-type connection. The problem is Apple's developer examples and documentation are relatively sparse, and don't really help at all. If anyone has any ideas, or places to look for more information, they would be appreciated.
Gizmotoy is offline   0 Reply With Quote
Old Apr 20, 2005, 12:53 PM   #2
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
I wrote a little Bluetooth terminal app a while ago. The source and app is available to Download.

Note that if you are using Bluetooth you need to stay single threaded. It stops working as soon as you go multi-threaded. You can get round it by doing all the coms in secondary helper app and talking to it over an NSConnection.
robbieduncan is offline   0 Reply With Quote
Old Apr 20, 2005, 04:19 PM   #3
Gizmotoy
Thread Starter
macrumors 6502a
 
Gizmotoy's Avatar
 
Join Date: Nov 2003
You know, it's a pretty funny coincidence that you replied here. As it happens, I have taken a look at your Bluetooth program. I found that it worked fine connecting to a Cell Phone (although I couldn't figure out anything to do with it. I did come across the AT commands for my T610). What is happening is that I'm trying to use Bluetooth to basically send text back and forth between a module (that will be implemented with a microcontroller on a separate PCB), and my PowerBook.

For some reason, I can't get your program to connect to the module. It simply crashes on initialization with no real error or anything. It is most likely a hardware error. The documentation for our chip is poor and I cannot figure out the proper AT commands it needs sent to enable it for serial communication. It does, however, appear to be almost exactly what I'm looking for.

Anyway, the main problem was that I am unable to compile your source in the first place. It says that I'm missing the RDAppKit framework (RDAppKit.h and RDAKUpdateController.h, which appear to be custom frameworks you created but did not include in the source). I did searches for it all over Google and Apple and found nothing. Do you know what I'm missing?

Last edited by Gizmotoy; Apr 20, 2005 at 04:25 PM.
Gizmotoy is offline   0 Reply With Quote
Old Apr 20, 2005, 04:27 PM   #4
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Oops. The App depends on a my own AppKit extension framework. See this zip file. You will need to tell XCode where to find the compiled FrameWork so as it will include it in the app. Or extract the compiled version included in the pre-compiled app you should already have...

Edit: Note that the terminal is really not very good. It works OK for phones but as it does not let you send control characters it might need some work for what you are doing.

Last edited by robbieduncan; Apr 20, 2005 at 04:29 PM.
robbieduncan is offline   0 Reply With Quote
Old Apr 20, 2005, 09:37 PM   #5
Gizmotoy
Thread Starter
macrumors 6502a
 
Gizmotoy's Avatar
 
Join Date: Nov 2003
Wow, that's great. Thanks! I'll give it a shot and see how it goes.

Thinking through, I can't come up with any reason why we'd need to send control characters. The other Bluetooth module will be initialized by our microcontroller. We just need to be able to open a serial connection on the PowerBook's Bluetooth chip. This would of course be connected to the external module. All we really need is to be able to send text over the link.

I wanted to ask... how does your terminal determine if a phone supports the proper protocols to connect? Does it just look for, for example "Serial Port 1" (one of the listed services on my T616)? Or does the chip need to be set up in some certain way?

Thanks for the help, and that framework especially.
Gizmotoy is offline   0 Reply With Quote
Old Apr 21, 2005, 02:52 AM   #6
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Nope, it doesn't check anything. It basically assumes that the other end will accept standard AT style commands. As such it simply sends the text as typed to the other device. It attempts to open an RFCOM serial channel to do this. If the other device does not support this then the connection should fail.
robbieduncan is offline   0 Reply With Quote
Old Apr 21, 2005, 10:02 AM   #7
Gizmotoy
Thread Starter
macrumors 6502a
 
Gizmotoy's Avatar
 
Join Date: Nov 2003
Alrighty, well that pretty much answered my question. We must be having a problem setting up the external chip for serial communications. The chip supports RFCOMM, but the setup process is complicated and undocumented. Something must be going wrong on that end. Thanks for the help.
Gizmotoy is offline   0 Reply With Quote
Old Apr 25, 2005, 02:48 PM   #8
Gizmotoy
Thread Starter
macrumors 6502a
 
Gizmotoy's Avatar
 
Join Date: Nov 2003
Just wanted to chime back in saying that we were able to get everything working properly. Once we had your custom framework, I was able to get the program to compile properly. To get your terminal to connect to our chip, we had to change the default from channel 5 to channel 1. Once we did that, it connected right up.

Thanks for the help.
Gizmotoy is offline   0 Reply With Quote
Old Apr 25, 2005, 02:50 PM   #9
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Cool

Glad to here it's all working now. I hope you manage to do whatever it is you are trying to do!
robbieduncan is offline   0 Reply With Quote
Old Apr 16, 2007, 09:39 AM   #10
hvassing
macrumors newbie
 
Join Date: Apr 2007
Location: Oslo, Norway
Robbie Duncan:
Could you please make the RDAppKit framework available again? It would also be great if you could write some more example code on to use the Bluetooth AT Terminal app.
hvassing is offline   0 Reply With Quote
Old Apr 16, 2007, 09:52 AM   #11
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by hvassing View Post
Robbie Duncan:
Could you please make the RDAppKit framework available again? It would also be great if you could write some more example code on to use the Bluetooth AT Terminal app.
I'll check where the zip is later. I'm sure it's hosted on my site but not linked for some reason.

I'm not about to research the AT command sets required to write more examples: that's up to you. Google is there for a reason.
robbieduncan is offline   0 Reply With Quote
Old Apr 16, 2007, 10:27 AM   #12
hvassing
macrumors newbie
 
Join Date: Apr 2007
Location: Oslo, Norway
Quote:
Originally Posted by robbieduncan View Post
I'll check where the zip is later. I'm sure it's hosted on my site but not linked for some reason.

I'm not about to research the AT command sets required to write more examples: that's up to you. Google is there for a reason.
Thanks!
I didn't mean it like that. I was just wondering because of the help-file in the Bluetooth AT app, and the example-page on your homepage. I'm just glad some wrote this kind of an app
hvassing is offline   0 Reply With Quote
Old Apr 16, 2007, 10:47 AM   #13
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
iirc those documents are about the limit of my usage. I used it as a learning tool for an app I started writing but never released due to stability and complexity issues that would synchronise the SMS messages from a phone to a local storage area. Once there it would hold them forever (so you could delete them from your phone). It had a Mail style interface with folders etc. Thinking about it it's the sort of app that people still want. If only I had the time!
robbieduncan is offline   0 Reply With Quote
Old Apr 16, 2007, 11:19 AM   #14
Eraserhead
macrumors G4
 
Eraserhead's Avatar
 
Join Date: Nov 2005
Location: UK
Quote:
Originally Posted by robbieduncan View Post
iirc those documents are about the limit of my usage. I used it as a learning tool for an app I started writing but never released due to stability and complexity issues that would synchronise the SMS messages from a phone to a local storage area. Once there it would hold them forever (so you could delete them from your phone). It had a Mail style interface with folders etc. Thinking about it it's the sort of app that people still want. If only I had the time!
Sounds interesting, and pretty useful, especially if your phone is like mine and makes you delete texts after the first hundred or so... Why not release the source you have under the GPL? At some stage I might take a look at it. (though if the iPhone can store texts on it's gigabytes of storage I'll probably just use that ).
Eraserhead is offline   0 Reply With Quote
Old Apr 16, 2007, 11:25 AM   #15
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by Eraserhead View Post
Sounds interesting, and pretty useful, especially if your phone is like mine and makes you delete texts after the first hundred or so... Why not release the source you have under the GPL? At some stage I might take a look at it. (though if the iPhone can store texts on it's gigabytes of storage I'll probably just use that ).
At the moment I don't think it even compiles. If it worked at all I'd be happy to! If anyone wants a copy of it AS IS (source only) then please feel free to PM me with an email address and I'll send you a zip. If I get a second and can get the code cleaned up and compiling I'll post a thread here with a download link.

Edit it add: it only ever worked with my Sony Ericsson phone. Although iirc I designed it so as you could extend it to support other phone types quite easily.
robbieduncan is offline   0 Reply With Quote
Old Apr 16, 2007, 01:22 PM   #16
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
OK RDAppKit is now here
robbieduncan is offline   0 Reply With Quote
Old Apr 16, 2007, 02:21 PM   #17
Eraserhead
macrumors G4
 
Eraserhead's Avatar
 
Join Date: Nov 2005
Location: UK
OK, I'm gonna take a look at this over the next few weeks, I will stick the source up online quite soon on my website at
http://smscommander.erasersoft.com

if that doesn't work the direct link is http://www.erasersoft.com/smsCommander.html

I haven't looked at the source much yet, but I'll take a look over the next couple of weeks.

Last edited by Eraserhead; Feb 26, 2008 at 01:07 PM.
Eraserhead is offline   0 Reply With Quote
Old May 18, 2008, 08:25 AM   #18
ptrael
macrumors newbie
 
Join Date: Jun 2006
Can anyone post a link for RDAppKit?
ptrael is offline   0 Reply With Quote
Old May 18, 2008, 10:03 AM   #19
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
It's too large to attach here by 4Kb PM me your email address and I'll send you a copy...
robbieduncan is offline   0 Reply With Quote
Old Aug 11, 2008, 08:04 AM   #20
tomtom5005
macrumors newbie
 
Join Date: Aug 2008
Location: Providence, Rhode Island
Quote:
Originally Posted by robbieduncan View Post
It's too large to attach here by 4Kb PM me your email address and I'll send you a copy...
Robbie,
As you can tell I am a Newbie. I am interested in being able to send data out of an iphone via the blue tooth port. Nothing very complex, perhaps just signed integers. From the posts on this thread I can see that you have done something like this on a mac. Can you direct me to your application and frameworks and any help documentation you have? When i try to go to your site I get a website for an ISP instead. I really appreciate your help::
tomtom5005 is offline   0 Reply With Quote
Old Aug 11, 2008, 08:08 AM   #21
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by tomtom5005 View Post
Robbie,
As you can tell I am a Newbie. I am interested in being able to send data out of an iphone via the blue tooth port. Nothing very complex, perhaps just signed integers. From the posts on this thread I can see that you have done something like this on a mac. Can you direct me to your application and frameworks and any help documentation you have? When i try to go to your site I get a website for an ISP instead. I really appreciate your help::
PM me your email address and I'll send you the code. My website is down and will probably not come back up for a while!

I've no experience of using bluetooth on the iPhone so I've no idea if it's possible to do what you want or not...
robbieduncan is offline   0 Reply With Quote
Old Aug 11, 2008, 08:12 AM   #22
tomtom5005
macrumors newbie
 
Join Date: Aug 2008
Location: Providence, Rhode Island
Robbie,
thank you.
my email is
Also i took a look at your Arctic escapade. Looks like you had fun.
Thankyou for you help.

Last edited by tomtom5005; Aug 11, 2008 at 09:35 AM.
tomtom5005 is offline   0 Reply With Quote
Old Aug 11, 2008, 08:18 AM   #23
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by tomtom5005 View Post
Robbie,
thank you.
my email is <removed>
Also i took a look at your Arctic escapade. Looks like you had fun.
Thankyou for you help.
Tom, I meant send it in a Private Message (top right of the screen) rather than post it here to keep it private. You might want to edit your message to remove it as spammers automatically trawl forums to get email addresses

And yes Norway was fun

I have the address now: I'll send you the code when I get home (at work now, no access to a Mac)
robbieduncan is offline   0 Reply With Quote
Old Aug 11, 2008, 09:37 AM   #24
tomtom5005
macrumors newbie
 
Join Date: Aug 2008
Location: Providence, Rhode Island
Thankyou for your help and kindness. I will email you if i am able to make the iphone bluetooth transmission work
tomtom5005 is offline   0 Reply With Quote
Old Aug 14, 2008, 10:45 AM   #25
flofl
macrumors newbie
 
Join Date: Aug 2008
Location: France
BT Barcode Scanner

Hello everyone!

My project is to comunicate with my Microvision BT ROV barcode scanner.

Quote:
Originally Posted by robbieduncan View Post
PM me your email address and I'll send you the code. My website is down and will probably not come back up for a while!
Well, Robbie, Iíve just registered so I canít PM people for the moment, but when Iíll be able to, I hope you will be OK to share your code with me too.
Your framework is referenced in many places, even in French forums!

For the moment I succeeded in receiving barcode data with help of Appleís RFCOMMSPPTestController, but when it comes to sending data, Iím lostÖ

See you,

Flofl.
flofl is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Cannot use bluetooth keyboard and bluetooth mouse at the same time nasachusetts MacBook Pro 2 Mar 13, 2013 08:31 PM
Sharing Bluetooth devices between computers using a USB Bluetooth dongle? nerd05 Mac Peripherals 1 Feb 9, 2013 02:59 PM
General: Bluetooth hack project - Silverlit Bluetooth R/C car dzzl Jailbreaks and iOS Hacks 1 Jan 3, 2013 04:14 PM
Miwi on demand Bluetooth trigger and bluetooth data? whyrichard Jailbreaks and iOS Hacks 1 Jun 22, 2012 06:31 AM

Forum Jump

All times are GMT -5. The time now is 02:06 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC