/dev/rfcomm0 goes stale, but I can see Bluetooth device is still sending data
I am working with a Bluetooth sensor device on Linux. I use the standard tools to connect to it on a serial port, so:
$ sudo rfcomm connect 0
Connected /dev/rfcomm0 to 00:07:80:93:52:3B on channel 1
Press CTRL-C for hangup
I have a Java program that reads from /dev/rfcomm0 and processes the data. However, after a while (varying time ~1hr), I can't read any further data, but the device is still connected. I note the following:
- If I open the Bluetooth manager, it shows me that data is still flowing from the device
- cat /dev/rfcomm0 shows no output
- The connectio开发者_运维技巧n, still exists. I have to manually close the connection, reconnect and restart my Java app.
So essentially, the connection, /dev/rfcomm0, seems to go stale. Is this a simple thing to fix? Will it be my app or is it to do with the serial port? What can the problem be?
Many thanks
精彩评论