Author Topic: Extending a project to include wireless control  (Read 3814 times)

0 Members and 1 Guest are viewing this topic.

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Extending a project to include wireless control
« on: January 16, 2009, 04:23:42 pm »
I have a microcontroller project that currently accepts input via a serial connection.  I'd like to extend by allowing wireless input.  I've done a bit of research and decided the easiest way would be for me to use the Bluetooth Serial profile (adding a Bluetooth module to implement a serial bluetooth receiver should be easy).  The part I have no experience with is creating an application to utilize the bluetooth stack and create the serial connection.  I was wondering if anyone had any experience here with bluetooth programming, or even j2me/similar mobile programs as I will likely want the application to work on my cell phone or PDA (Palm OS 2.x). 

Some specific questions I have include,
  • Do I need to include device discovery as part of the steps to create a Serial connection between the controller and device?
  • Are there any pitfalls to avoid when developing a mobile program compared to a desktop application or programming for an embedded device (a la microcontroller programming)?
  • Recommendations on language, API, IDE, or platform to use?

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: Extending a project to include wireless control
« Reply #1 on: January 16, 2009, 04:34:42 pm »
After reading this tutorial, I'm also wondering what the difference is between the OBEX Serial profile and the RFCOMM data streaming level and what the advantages of each are if different.

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Extending a project to include wireless control
« Reply #2 on: January 30, 2009, 10:49:13 am »
You need device discovery in order to pair with another bluetooth device, but you needn't necessarily implement discoverability on your device (your device could have it initiate pairing with another discoverable device) unless you're actually trying to get it certified with the BT logo.

OBEX is for object (ie, file) transfers. RFCOMM drives a COM port, so your code needn't even know that bluetooth is involved.

I'm not sure if there's a difference between OBEX and OBEX Serial, but if there is then there's probably some reason why RFCOMM is better suited for your application -- since you already have a serial wired COM port.

[edit] If you buy BT hardware designed for beginners, it should come with driver code and at least an RFCOM profile in C.
« Last Edit: January 30, 2009, 10:51:34 am by Camel »

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: Extending a project to include wireless control
« Reply #3 on: January 30, 2009, 11:41:41 am »
I've made considerable progress on this.  My bluetooth module is capable of using RFCOMM to RS232 conversion.  I do not need two way transfer, so I am thinking that I will make set the module up as the Server and register a port for the client to discover.  I'm not using a kit but the Data Sheet for the module explains how to set the device up for this mode so that isn't an issue.  I've found that there is a good set of JSRs implemented for J2ME compatible phones, but unfortunately the one I would like to use (JSR 183, telephony) has not been implemented on a single device despite unanimous signoff by all of the participants over 2 years ago.  The Symbian APIs looked the best suited for my project, but I don't have a Symbian smart phone, so I'm sticking with the dated Palm OS API.  As you hinted, it turns out the bluetooth device discovery and RFCOMM serial connection have turned out to be the easy parts of the project :)

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Extending a project to include wireless control
« Reply #4 on: January 31, 2009, 03:06:37 am »
I've found that there is a good set of JSRs implemented for J2ME compatible phones, but unfortunately the one I would like to use (JSR 183, telephony) has not been implemented on a single device despite unanimous signoff by all of the participants over 2 years ago.
A career in OOD is bound to have its drawbacks :P

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!