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

@@ -14,6 +14,7 @@
//! HCI packet transport
use crate::wrapper::controller::Controller;
use pyo3::{intern, types::PyModule, PyObject, PyResult, Python};
/// A source/sink pair for HCI packet I/O.
@@ -67,6 +68,18 @@ impl Drop for Transport {
#[derive(Clone)]
pub struct Source(pub(crate) PyObject);
impl From<Controller> for Source {
fn from(value: Controller) -> Self {
Self(value.0)
}
}
/// The sink side of a [Transport].
#[derive(Clone)]
pub struct Sink(pub(crate) PyObject);
impl From<Controller> for Sink {
fn from(value: Controller) -> Self {
Self(value.0)
}
}