×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    18

    Two bluetooth rfcomm ports???

    Hi all,
    Hope someone can point me the right way? I have a programme running on a n70 which requires two bluetooth serial ports to run at the same time. The first I have had running no problem, the second works ok untill I try to read it using the readline() function.

    Here is the code I'm using for the second connection;
    Code:
    try:
                appuifw.note(u"Connecting to weigher")
                weigher="00:12:01:11:00:62"
                address1,services1=socket.bt_discover(weigher)
                target1= (address1, services1.values()[0])
                conn1 = socket.socket(socket.AF_BT, socket.SOCK_STREAM)
                conn1.connect(target1)
                scale = conn1.makefile("rW",0)
                appuifw.note(u"Blue weigher connected")
    
            except:
                appuifw.note(u"Unable to find weigher")
            
            print >> scale,"W"
            while True:
                heavy = scale.readline()
                appuifw.note(u"U"+str(heavy))
                print >>scale,"W"
    As you might guess its connecting a load cell to the phone using a serial bluetooth module and pic. The pic responds to the print>>scale,"W" so I know its connected ok, I've also checked the output in hyperterminal so I know its sending somthing back but the programme stalls at heavy=scale.readline()
    The first connection is working when I try to use this, however disabling that connection makes no difference. Any ideas?
    Thanks Geoff

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: Two bluetooth rfcomm ports???

    Are you sure about 'readline'? It might (I do not know for sure) wait indefinitely if there is no trailing linebreak.

  3. #3
    Registered User
    Join Date
    Feb 2012
    Posts
    18

    Re: Two bluetooth rfcomm ports???

    Thanks for the quick relpy! I think you could be right, both ports are communicating with a pic, checking my pic code it looks like I may have put a new line in the first programme but not the second?
    Am going to check it out now.

  4. #4
    Registered User
    Join Date
    Feb 2012
    Posts
    18

    Re: Two bluetooth rfcomm ports???

    Thanks for the advice, your quite right, I added a new line character to my pic programme, works a treat now!

Similar Threads

  1. bluetooth +Serial ports+Symbian
    By narayanc1 in forum Mobile Java Networking & Messaging & Security
    Replies: 7
    Last Post: 2009-10-28, 12:45
  2. Bluetooth - RFCOMM
    By yasomca in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2009-02-07, 04:35
  3. RFCOMM bluetooth
    By Rimmi99 in forum Bluetooth Technology
    Replies: 3
    Last Post: 2007-05-14, 14:52
  4. Problem: 10 Bluetooth Ports simultaneously
    By Alco Fresh in forum Symbian
    Replies: 1
    Last Post: 2006-07-03, 12:05
  5. PC-Suite does not sho COM ports from 3COM-Bluetooth 3CREB96B
    By rocketpork in forum Bluetooth Technology
    Replies: 1
    Last Post: 2003-06-18, 11:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×