linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Castellotti <sc@puzzlebox.info>
To: linux-bluetooth@vger.kernel.org
Subject: Re: seeking debug advice for a hanging serial device
Date: Mon, 02 Aug 2010 16:21:58 -0700	[thread overview]
Message-ID: <1280791318.2550.6.camel@localhost> (raw)
In-Reply-To: <1280521176.2338.45.camel@localhost>

On Fri, 2010-07-30 at 13:19 -0700, Steve Castellotti wrote: 
> However under Linux, the device frequently hangs within 5 seconds of
> attempting to read the data stream.
> 
>     This occurs whether through my code (which is platform agnostic) or
> simply cat'ing the RFCOMM device from a console (both in normal and raw
> mode).

Just to follow up on my own email (for the sake of future Google
searchers), I did arrive at a solution to my problem.

I switched to using the pybluez "bluetooth" module under Linux and
talking to the Bluetooth device using sockets instead of the RFCOMM
serial device:

http://pybluez.googlecode.com/svn/www/docs-0.7/index.html


Some example code:


import bluetooth

address = "XX:XX:XX:XX:XX:XX"

port = 3 # connect to channel 3

socket = bluetooth.BluetoothSocket( bluetooth.RFCOMM )
socket.connect((address, port))

while True:
   try:
      byte = sock.recv(1)
      print byte
   except Exception, e:
      print e

sock.close()


I still don't understand why attempting to access the RFCOMM serial
device directly was failing under Linux but at least I am able to
proceed with my driver development.


Cheers

Steve Castellotti



      reply	other threads:[~2010-08-02 23:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30 20:19 seeking debug advice for a hanging serial device Steve Castellotti
2010-08-02 23:21 ` Steve Castellotti [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1280791318.2550.6.camel@localhost \
    --to=sc@puzzlebox.info \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).