LinuxKoku
Posts: 75
Joined: Wed May 16, 2018 9:16 am
Location: France
Contact: Website

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

Thu Jul 05, 2018 1:21 pm

Hello,

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 (https://pyserial.readthedocs.io/en/late ... 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
Last edited by LinuxKoku on Fri Jul 06, 2018 9:26 am, edited 1 time in total.
Thank you all :)

LinuxKoku
Posts: 75
Joined: Wed May 16, 2018 9:16 am
Location: France
Contact: Website

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

Fri Jul 06, 2018 9:24 am

Hello,

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
Thank you all :)

Return to “Python”