Drone

Struct Drone 

Source
pub struct Drone {
    pub time_start: Instant,
    pub time_transfer: Instant,
    pub time_receive: Instant,
    pub receiver: Receiver,
    pub header: Header,
    pub vec_data: Vec<u8>,
    pub data: Data,
    pub flag_show_debug_message: bool,
}

Fields§

§time_start: Instant§time_transfer: Instant§time_receive: Instant§receiver: Receiver§header: Header§vec_data: Vec<u8>§data: Data§flag_show_debug_message: bool

Implementations§

Source§

impl Drone

Source

pub fn new() -> Drone

Source

pub fn set_show_debug_message(&mut self, flag_show_debug_message: bool)

Source

pub fn push(&mut self, b: u8)

Source

pub fn push_slice(&mut self, slice_data: &[u8])

Source

pub fn check(&mut self) -> bool

Source

pub fn get_time_passed_from_start(&self) -> u128

Source

pub fn get_time_passed_from_last_transfer(&self) -> u128

Source

pub fn get_time_passed_from_last_receive(&self) -> u128

Source

pub fn sleep(&self, time_sleep_ms: u64)

Source

pub fn request(&mut self, target: DeviceType, data_type: DataType) -> Vec<u8>

Source

pub fn command( &mut self, target: DeviceType, command_type: CommandType, option: u8, ) -> Vec<u8>

Source

pub fn flight_event(&mut self, event: FlightEvent) -> Vec<u8>

Source

pub fn takeoff(&mut self) -> Vec<u8>

Source

pub fn landing(&mut self) -> Vec<u8>

Source

pub fn stop(&mut self) -> Vec<u8>

Source

pub fn set_default(&mut self) -> Vec<u8>

Source

pub fn set_mode_control_flight(&mut self) -> Vec<u8>

Source

pub fn headless(&mut self, headless: Headless) -> Vec<u8>

Source

pub fn clear_bias(&mut self) -> Vec<u8>

Source

pub fn clear_trim(&mut self) -> Vec<u8>

Source

pub fn trim( &mut self, roll: i16, pitch: i16, yaw: i16, throttle: i16, ) -> Vec<u8>

Source

pub fn control(&mut self, roll: i8, pitch: i8, yaw: i8, throttle: i8) -> Vec<u8>

Source

pub fn control_request( &mut self, roll: i8, pitch: i8, yaw: i8, throttle: i8, data_type: DataType, ) -> Vec<u8>

Source

pub fn control_position( &mut self, x: f32, y: f32, z: f32, velocity: f32, heading: i16, rotational_velocity: i16, ) -> Vec<u8>

Source

pub fn battle_ir_message(&mut self, ir_message: u8) -> Vec<u8>

Source

pub fn battle_light_event_command( &mut self, target: DeviceType, event: u8, interval: u16, repeat: u8, r: u8, g: u8, b: u8, command_type: CommandType, option: u8, ) -> Vec<u8>

Source

pub fn battle_ir_message_light_event_command( &mut self, target: DeviceType, ir_message: u8, event: u8, interval: u16, repeat: u8, r: u8, g: u8, b: u8, command_type: CommandType, option: u8, ) -> Vec<u8>

Source

pub fn light_manual( &mut self, target: DeviceType, flags: u16, brightness: u8, ) -> Vec<u8>

Source

pub fn light_mode( &mut self, target: DeviceType, mode: u8, interval: u16, ) -> Vec<u8>

Source

pub fn light_event( &mut self, target: DeviceType, event: u8, interval: u16, repeat: u8, ) -> Vec<u8>

Source

pub fn light_mode_color( &mut self, target: DeviceType, mode: u8, interval: u16, r: u8, g: u8, b: u8, ) -> Vec<u8>

Source

pub fn light_event_color( &mut self, target: DeviceType, event: u8, interval: u16, repeat: u8, r: u8, g: u8, b: u8, ) -> Vec<u8>

Source

pub fn light_default( &mut self, target: DeviceType, mode: u8, interval: u16, r: u8, g: u8, b: u8, ) -> Vec<u8>

Source

pub fn buzzer_stop(&mut self, target: DeviceType) -> Vec<u8>

Source

pub fn buzzer_scale( &mut self, target: DeviceType, scale: Scale, time: u16, ) -> Vec<u8>

Source

pub fn buzzer_scale_reserve( &mut self, target: DeviceType, scale: Scale, time: u16, ) -> Vec<u8>

Source

pub fn buzzer_hz(&mut self, target: DeviceType, hz: u16, time: u16) -> Vec<u8>

Source

pub fn buzzer_hz_reserve( &mut self, target: DeviceType, hz: u16, time: u16, ) -> Vec<u8>

Source

pub fn buzzer_mute(&mut self, target: DeviceType, time: u16) -> Vec<u8>

Source

pub fn buzzer_mute_reserve(&mut self, target: DeviceType, time: u16) -> Vec<u8>

Source

pub fn vibrator(&mut self, on: u16, off: u16, time: u16) -> Vec<u8>

Source

pub fn vibrator_reserve(&mut self, on: u16, off: u16, time: u16) -> Vec<u8>

Source

pub fn draw_clear_all(&mut self, pixel: Pixel) -> Vec<u8>

Source

pub fn draw_clear( &mut self, x: i16, y: i16, width: i16, height: i16, pixel: Pixel, ) -> Vec<u8>

Source

pub fn draw_invert( &mut self, x: i16, y: i16, width: i16, height: i16, ) -> Vec<u8>

Source

pub fn draw_point(&mut self, x: i16, y: i16, pixel: Pixel) -> Vec<u8>

Source

pub fn draw_line( &mut self, x1: i16, y1: i16, x2: i16, y2: i16, pixel: Pixel, line: Line, ) -> Vec<u8>

Source

pub fn draw_rect( &mut self, x: i16, y: i16, width: i16, height: i16, pixel: Pixel, fill: bool, line: Line, ) -> Vec<u8>

Source

pub fn draw_circle( &mut self, x: i16, y: i16, radius: i16, pixel: Pixel, fill: bool, ) -> Vec<u8>

Source

pub fn draw_string( &mut self, x: i16, y: i16, font: Font, pixel: Pixel, string: String, ) -> Vec<u8>

Source

pub fn draw_string_align( &mut self, x_start: i16, x_end: i16, y: i16, align: Align, font: Font, pixel: Pixel, string: String, ) -> Vec<u8>

Source

pub fn draw_image( &mut self, x: i16, y: i16, width: i16, height: i16, vec_image: Vec<u8>, ) -> Vec<u8>

Auto Trait Implementations§

§

impl Freeze for Drone

§

impl RefUnwindSafe for Drone

§

impl Send for Drone

§

impl Sync for Drone

§

impl Unpin for Drone

§

impl UnwindSafe for Drone

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.