Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the output is a bit "bursty" #1

Open
davidgyoung opened this issue Apr 12, 2021 · 1 comment
Open

the output is a bit "bursty" #1

davidgyoung opened this issue Apr 12, 2021 · 1 comment

Comments

@davidgyoung
Copy link
Owner

@plotti asked, "I gave it a try and it works well, but the output is a bit "bursty" for 1-2 seconds i get nothing then 3-4 things at once then nothing for 1-2 seconds and so on. Is there a way i can make it return results each 0.5 seconds constantly?" -- https://gist.github.com/davidgyoung/0127ad914ea1b6b0f21a53ac3bb97ad3#gistcomment-3703360

@davidgyoung
Copy link
Owner Author

The program will send the detection to STDOUT immediately after it gets a scan callback from the Bluetooth stack. This typically happens within a few milliseconds. So if you are seeing delays, this likely means the text output is buffering as it is piped to another program. Only once the buffer gets full does the output get flushed and arrive at the program reading it.

The solution really depends on your program that consumes the output. I often write consuming programs in Ruby, and I use the PTY Gem to get the output from the CLI utility. I find I get the results delivered very quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant