Page 1 of 1

[Solved] Number of bytes in the Serial Bluetooth Buffer (PyBluez)

Posted: Thu Jul 05, 2018 1:21 pm
by LinuxKoku

I just made a program that allows me to read on the port of the internal bluetooth Raspberry PI, so I create an infinite loop to read all the bytes received, but to stop the loop I want to put a condition for him that it stops if there is nothing more in the Buffer, to realize I am looking for a function of PyBluez to return the number of bytes in the Buffer like the function inWaiting of PySerial ( ... tive-ports ... look inWaiting in the page, to understand its use).

:?: But I work with bluetooth, so and I would like to know what is the equivalent function of inWaiting of PySerial in PyBluez for the serial use of bluetooth

Thank you all

Re: Number of bytes in the Serial Bluetooth Buffer (PyBluez)

Posted: Fri Jul 06, 2018 9:24 am
by LinuxKoku

I wanted to have the number bytes in the buffer, to make a condition to get out of an infinite loop that displays what is received in the Buffer, and having not found this function equivalent, I used the function sock.sett imeout(time) to exit the Bluetooth send / receive function if no action is taken! and it perfectly meets my expectations.

Thank you