Serial Port Profile & Bluetooth

Discussion in 'Questions (Windows Mobile)' started by Paul, Jul 26, 2007.

  1. Paul

    Paul Member Licensed User

    Hi,
    I have developed an application which uses the serial port oon a pda via appropriate cable. However, the client now wants to use bluetooth with a different make of pda (as yet unknown). My question is what do I need to do to use bluetooth instaed of a cable as I have never used bluetooth before. I was told that I need SPP (Serial Port Profile) software installed. What is this and where do I get it.
    Thanks again for any help.

    Regards
    Paul:sign0085:
     
  2. agraham

    agraham Expert Licensed User

    Bluetooth can emulate a Serial (Com) Port so as long as your app can find the appropriate Com port then you should only need minimal or no changes to your app itself (baud rate setting by the app is not available for example).

    For example the Bluetooth stack on my Axim X30 offers a Serial Port service that both Microsoft Pocket Streets and Anquet Maps can connect to without even knowing that the GPS receiver they are talking to is a Bluetooth device rather than connected to a real Serial Port. The actual Com ports (Com7 and Com8 are the defaults on my Axim) can be configured in the Serial Port service parameters and also in Pocket Streets and Anquet.

    I think that it is down to the Bluetooth device to request that service from the PDA so as long as whatever device your app talks to can do this you should have no trouble.
     
  3. Erel

    Erel Administrator Staff Member Licensed User

  4. dzt

    dzt Active Member Licensed User

    You should first pair your mobile device with the "unknown device". And then make an "outgoing serial port" if your "unknown device" supports such a service. Until then no virtual serial port exists.

    I've tested this approach with various bluetooth GPS receivers, bluetooth printers and mobile phones with bluetooth capability with success.
     
  5. Paul

    Paul Member Licensed User

    How to set up inbound and outbound com port

    Help,
    I can't figure out how to set up seperate inbound and outbound comm ports for use with bluetooth. Could someone show me an example, please?.

    Thanks, Paul
     
  6. agraham

    agraham Expert Licensed User

    YOU don't set them up, the Bluetooth driver stack does. I think that you just need to open the Com port and talk to it. The sequence to use my Bluetooth GPS with my Axim is as follows.

    Examine the Bluetooth setup parameters - for me this goes
    Start -> Settings -> Connections -> Bluetooth -> Services -> Serial Port
    Make sure the service is enabled then
    -> Advanced
    The inbound and outbound Com port numbers are displayed and can be changed if required. I note the Outbound Com port number (in this case Com7 is the default). I confess to not having researched the reason for having an inbound and an outbound port but I know, by experiment, that my GPS uses an outbound port.

    Start the GPS application, in my case either Anquet Maps or Pocket Streets.
    In their GPS setup menu make sure the Com port number is the outbound number noted above. Pocket Streets allows you to select only a Com port number, Anquet gives you a baud rate selection option as well and I leave that at the default of 4800.

    Turn on the Bluetooth device and then in the application turn on GPS tracking. Depending upon the device Bluetooth stack settings a selection screen showing the GPS device may or may not appear - if it doesn't the connection is made automatically, if it does then I select the device and it all works.

    The applications don't care if the Com port is real or a Bluetooth one. For example on my laptop using Autoroute or Anquet Maps I can connect to either a real serial port GPS and a Bluetooth GPS just by selecting the correct Com port. I have a GPS test program and that doesn't care either (although another GPS test program that I had DID care - don't know why, trying to access the (non-existent) hardware I guess). I seem to remember also connecting in Hyperterminal with the the Com port number noted above to see the data stream coming from the GPS and that worked fine too.
     
Loading...