4

How to scan Bluetooth "classic" and LE devices at the same time in C++? I'm using library BlueZ in C++ on Linux (OpenWrt, Ubuntu) and I know how to scan classic device and low-energy device separately, but I need all devices in one shot. The same way how it works in Android or Ubuntu.

My solution for now is do first classic scan and then lescan, but it takes a long time. For example: classic scan ~8sec, lescan ~6sec. And which one should be first? I want to get all nearby devices in as short period of time.

Martin Special
  • 141
  • 1
  • 7
  • 1
    Have you considered writing a function that scans for one then the other? If not, why not? If so, what went wrong? – Yakk - Adam Nevraumont Dec 06 '17 at 12:58
  • 1
    Yes, this is my solution for now, but it takes a long time. For example: classic scan ~8sec, lescan ~6sec. And which one should be first? I wanna know all nearby devices asap. – Martin Special Dec 06 '17 at 15:23
  • 1
    so your problem isn't how to do it, but how to do it fast. Can you fold that into your question? – Yakk - Adam Nevraumont Dec 06 '17 at 15:28
  • "on Linux"... "in Ubuntu". Ubuntu *is* Linux. Perhaps you mean some particular system tool in Ubuntu (tell us which). – Ben Voigt Dec 06 '17 at 16:02
  • Note: it's worth avoiding "ASAP" on Stack Overflow, since it is often used by overly-demanding question authors to request special/urgent attention on their questions. I have tried to fix that in the post. – halfer Dec 06 '17 at 16:34

0 Answers0