forked from auracaster/bumble_mirror
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user