hciraw 1.0.1

The interface to HCI Raw Sockets
Documentation
  • Coverage
  • 78.57%
    11 out of 14 items documented5 out of 11 items with examples
  • Size
  • Source code size: 15.14 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 529.46 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • kzapalowicz/hciraw
    0 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • konradzapalowicz

hciraw

The Rust interface to the HCI raw sockets. It is useful for anybody who wants to have a direct access to the Bluetooth controller.

Example

use hciraw::{HciChannel, HciRawSocket, HciSocketAddr};

fn main() -> std::io::Result<()> {
    let addr = hciraw::HciSocketAddr::new(None, HciChannel::Control);
    let socket = hciraw::HciSocket::bind(addr)?;

    let sdata: [u8; 6] = [0x01, 0x00, 0xff, 0x00, 0x00];
    let snum = socket.send(&sdata)?;
    println!("Send {} bytes", snum);

    let mut rbuf = vec![0;128];
    rnum = socket.recv(rbuf.as_mut_slice())?;
    println!("Read {} bytes", rnum);
}