Re: seeking debug advice for a hanging serial device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux