Replies: 2 comments 2 replies
-
|
It would be nice to have a pure-python equivalent to RootCanal. But it is a lot of work, if you want to be full-featured (Classic + LE, with ACL, SCO, ISO, multi-phym ranging, ...). |
Beta Was this translation helpful? Give feedback.
-
Yes, this is the big appeal of Bumble being pure Python. Being able to customize every aspect of every possible operation is important to be able to emulate real-world Blueototh adapters and peripherals. Real-world devices are not always well-behaved and follow the rules. So to be able to override the default implementation in just a few key places makes it really easy to reproduce the quirks of real-world hardware without actually needing any hardware. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am considering whether we should remake our controller emulation. The current implementation majorly serves our local unit tests, but it seems many users also use it to test their own host stacks, probably even more popular than RootCanal (if not considering its bundle with Android Emulator).
An significant advantage to emulate Bluetooth controllers in Python is - of source - easy to configure. Due to its original requirement to run inside Android, RootCanal is written in C++ and Rust, but C++ and Rust are not as easy as Python - they don't have so many packages ready to use like PIP, or fire-and-forget asyncio, and building on Windows is a big problem. Besides, Bluetooth emulation doesn't need extreme performance usually, so C++ and Rust cannot play their best here. (The same reasons are also valid for BlueZ btvirt as well)
However, I think just refine the current rule-based emulation and make it a Python version of RootCanal or btvirt is not enough. A better emulation should also simulate the broadcast nature of wireless communication. Real controllers and firmwares also send and receive a lot of LL/LMP packets from the air, and properly filter those useful for themselves. I guess this could help simplify the implementation, because we don't need each controllers to monitor all the others, so that lifecycle management will be simpler. Besides, the current emulations don't properly simulate the relationship between intervals and windows.
Beta Was this translation helpful? Give feedback.
All reactions