gearvr-controller 0.1.2

Read the Samsung Gear VR Controller (ET-YO324) over Bluetooth LE: packet decoding, orientation tracking and a btleplug transport
Documentation
//! What a connection to a controller reports.

use crate::protocol::Packet;

/// What a connection to a controller reports.
///
/// The background task started by `ble::events` sends these. The type needs no Bluetooth
/// itself, so another transport, such as a web page using Web Bluetooth, can send the same.
#[derive(Clone, Debug)]
pub enum Event {
    /// Looking for a controller. Sent once each time a search begins.
    Searching,
    /// Connected and receiving data.
    Connected {
        name: String,
        /// Battery charge in percent, if the controller reports it.
        battery: Option<u8>,
    },
    /// A data packet.
    Packet(Packet),
    /// The connection was lost. A new search follows.
    Disconnected,
    /// Something went wrong. The task keeps trying.
    Error(String),
}