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
sourceimpl Drone
impl Drone
pub fn new() -> Drone
pub fn set_show_debug_message(&mut self, flag_show_debug_message: bool)
pub fn push(&mut self, b: u8)
pub fn push_slice(&mut self, slice_data: &[u8])
pub fn check(&mut self) -> bool
pub fn get_time_passed_from_start(&self) -> u128
pub fn get_time_passed_from_last_transfer(&self) -> u128
pub fn get_time_passed_from_last_receive(&self) -> u128
pub fn sleep(&self, time_sleep_ms: u64)
pub fn request(&mut self, target: DeviceType, data_type: DataType) -> Vec<u8>
pub fn command(
&mut self,
target: DeviceType,
command_type: CommandType,
option: u8
) -> Vec<u8>
pub fn flight_event(&mut self, event: FlightEvent) -> Vec<u8>
pub fn takeoff(&mut self) -> Vec<u8>
pub fn landing(&mut self) -> Vec<u8>
pub fn stop(&mut self) -> Vec<u8>
pub fn set_default(&mut self) -> Vec<u8>
pub fn set_mode_control_flight(&mut self) -> Vec<u8>
pub fn headless(&mut self, headless: Headless) -> Vec<u8>
pub fn clear_bias(&mut self) -> Vec<u8>
pub fn clear_trim(&mut self) -> Vec<u8>
pub fn trim(
&mut self,
roll: i16,
pitch: i16,
yaw: i16,
throttle: i16
) -> Vec<u8>
pub fn control(&mut self, roll: i8, pitch: i8, yaw: i8, throttle: i8) -> Vec<u8>
pub fn control_request(
&mut self,
roll: i8,
pitch: i8,
yaw: i8,
throttle: i8,
data_type: DataType
) -> Vec<u8>
pub fn control_position(
&mut self,
x: f32,
y: f32,
z: f32,
velocity: f32,
heading: i16,
rotational_velocity: i16
) -> Vec<u8>
pub fn battle_ir_message(&mut self, ir_message: u8) -> Vec<u8>
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>
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>
pub fn light_manual(
&mut self,
target: DeviceType,
flags: u16,
brightness: u8
) -> Vec<u8>
pub fn light_mode(
&mut self,
target: DeviceType,
mode: u8,
interval: u16
) -> Vec<u8>
pub fn light_event(
&mut self,
target: DeviceType,
event: u8,
interval: u16,
repeat: u8
) -> Vec<u8>
pub fn light_mode_color(
&mut self,
target: DeviceType,
mode: u8,
interval: u16,
r: u8,
g: u8,
b: u8
) -> Vec<u8>
pub fn light_event_color(
&mut self,
target: DeviceType,
event: u8,
interval: u16,
repeat: u8,
r: u8,
g: u8,
b: u8
) -> Vec<u8>
pub fn light_default(
&mut self,
target: DeviceType,
mode: u8,
interval: u16,
r: u8,
g: u8,
b: u8
) -> Vec<u8>
pub fn buzzer_stop(&mut self, target: DeviceType) -> Vec<u8>
pub fn buzzer_scale(
&mut self,
target: DeviceType,
scale: Scale,
time: u16
) -> Vec<u8>
pub fn buzzer_scale_reserve(
&mut self,
target: DeviceType,
scale: Scale,
time: u16
) -> Vec<u8>
pub fn buzzer_hz(&mut self, target: DeviceType, hz: u16, time: u16) -> Vec<u8>
pub fn buzzer_hz_reserve(
&mut self,
target: DeviceType,
hz: u16,
time: u16
) -> Vec<u8>
pub fn buzzer_mute(&mut self, target: DeviceType, time: u16) -> Vec<u8>
pub fn buzzer_mute_reserve(&mut self, target: DeviceType, time: u16) -> Vec<u8>
pub fn vibrator(&mut self, on: u16, off: u16, time: u16) -> Vec<u8>
pub fn vibrator_reserve(&mut self, on: u16, off: u16, time: u16) -> Vec<u8>
pub fn draw_clear_all(&mut self, pixel: Pixel) -> Vec<u8>
pub fn draw_clear(
&mut self,
x: i16,
y: i16,
width: i16,
height: i16,
pixel: Pixel
) -> Vec<u8>
pub fn draw_invert(
&mut self,
x: i16,
y: i16,
width: i16,
height: i16
) -> Vec<u8>
pub fn draw_point(&mut self, x: i16, y: i16, pixel: Pixel) -> Vec<u8>
pub fn draw_line(
&mut self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
pixel: Pixel,
line: Line
) -> Vec<u8>
pub fn draw_rect(
&mut self,
x: i16,
y: i16,
width: i16,
height: i16,
pixel: Pixel,
fill: bool,
line: Line
) -> Vec<u8>
pub fn draw_circle(
&mut self,
x: i16,
y: i16,
radius: i16,
pixel: Pixel,
fill: bool
) -> Vec<u8>
pub fn draw_string(
&mut self,
x: i16,
y: i16,
font: Font,
pixel: Pixel,
string: String
) -> Vec<u8>
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>
pub fn draw_image(
&mut self,
x: i16,
y: i16,
width: i16,
height: i16,
vec_image: Vec<u8>
) -> Vec<u8>
Auto Trait Implementations
impl RefUnwindSafe for Drone
impl Send for Drone
impl Sync for Drone
impl Unpin for Drone
impl UnwindSafe for Drone
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more