Ability to send HCI commands from Rust

* Autogenerate packet code in Rust from PDL (packet file copied from rootcanal)
* Implement parsing of packets that have a type header
* Expose Python APIs for sending HCI commands
* Expose Python APIs for instantiating a local controller
This commit is contained in:
Gabriel White-Vega
2023-09-14 14:28:22 -04:00
parent c12dee4e76
commit 7e331c2944
16 changed files with 7041 additions and 72 deletions

View File

@@ -194,6 +194,21 @@ class Controller:
self.terminated = asyncio.get_running_loop().create_future()
@classmethod
async def create(
cls,
name,
host_source=None,
host_sink: Optional[TransportSink] = None,
link=None,
public_address: Optional[Union[bytes, str, Address]] = None,
):
'''
Rust's pyo3_asyncio needs the constructor to be async in order to properly
inject a running loop for creating the `terminated` future.
'''
return Controller(name, host_source, host_sink, link, public_address)
@property
def host(self):
return self.hci_sink