Struct e_drone_sp::Drone
source · [−]pub struct Drone {
pub time_start: Instant,
pub time_transfer: Instant,
pub time_receive: Instant,
pub receiver: Receiver,
pub buffer: [u8; 1024],
pub port: Result<Box<dyn SerialPort>>,
pub flag_show_debug_message: bool,
}
Fields
time_start: Instant
time_transfer: Instant
time_receive: Instant
receiver: Receiver
buffer: [u8; 1024]
port: Result<Box<dyn SerialPort>>
flag_show_debug_message: bool
Implementations
sourceimpl Drone
impl Drone
pub fn new(port_name: &str) -> Drone
pub fn set_show_debug_message(&mut self, flag_show_debug_message: bool)
pub fn is_connected(&mut self) -> bool
pub fn check(&mut self) -> Data
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 send(&mut self, slice_data: &[u8]) -> bool
pub fn request(&mut self, target: DeviceType, data_type: DataType) -> bool
pub fn command(
&mut self,
target: DeviceType,
command_type: CommandType,
option: u8
) -> bool
pub fn flight_event(&mut self, event: FlightEvent) -> bool
pub fn takeoff(&mut self) -> bool
pub fn landing(&mut self) -> bool
pub fn stop(&mut self) -> bool
pub fn set_default(&mut self) -> bool
pub fn set_mode_control_flight(&mut self) -> bool
pub fn headless(&mut self, headless: Headless) -> bool
pub fn clear_bias(&mut self) -> bool
pub fn clear_trim(&mut self) -> bool
pub fn trim(&mut self, roll: i16, pitch: i16, yaw: i16, throttle: i16) -> bool
pub fn control(&mut self, roll: i8, pitch: i8, yaw: i8, throttle: i8) -> bool
pub fn control_request(
&mut self,
roll: i8,
pitch: i8,
yaw: i8,
throttle: i8,
data_type: DataType
) -> bool
pub fn control_position(
&mut self,
x: f32,
y: f32,
z: f32,
velocity: f32,
heading: i16,
rotational_velocity: i16
) -> bool
pub fn battle_ir_message(&mut self, ir_message: u8) -> bool
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
) -> bool
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
) -> bool
pub fn light_manual(
&mut self,
target: DeviceType,
flags: u16,
brightness: u8
) -> bool
pub fn light_mode(
&mut self,
target: DeviceType,
mode: u8,
interval: u16
) -> bool
pub fn light_event(
&mut self,
target: DeviceType,
event: u8,
interval: u16,
repeat: u8
) -> bool
pub fn light_mode_color(
&mut self,
target: DeviceType,
mode: u8,
interval: u16,
r: u8,
g: u8,
b: u8
) -> bool
pub fn light_event_color(
&mut self,
target: DeviceType,
event: u8,
interval: u16,
repeat: u8,
r: u8,
g: u8,
b: u8
) -> bool
pub fn light_default(
&mut self,
target: DeviceType,
mode: u8,
interval: u16,
r: u8,
g: u8,
b: u8
) -> bool
pub fn buzzer_stop(&mut self, target: DeviceType) -> bool
pub fn buzzer_scale(
&mut self,
target: DeviceType,
scale: Scale,
time: u16
) -> bool
pub fn buzzer_scale_reserve(
&mut self,
target: DeviceType,
scale: Scale,
time: u16
) -> bool
pub fn buzzer_hz(&mut self, target: DeviceType, hz: u16, time: u16) -> bool
pub fn buzzer_hz_reserve(
&mut self,
target: DeviceType,
hz: u16,
time: u16
) -> bool
pub fn buzzer_mute(&mut self, target: DeviceType, time: u16) -> bool
pub fn buzzer_mute_reserve(&mut self, target: DeviceType, time: u16) -> bool
pub fn vibrator(&mut self, on: u16, off: u16, time: u16) -> bool
pub fn vibrator_reserve(&mut self, on: u16, off: u16, time: u16) -> bool
pub fn draw_clear_all(&mut self, pixel: Pixel) -> bool
pub fn draw_clear(
&mut self,
x: i16,
y: i16,
width: i16,
height: i16,
pixel: Pixel
) -> bool
pub fn draw_invert(&mut self, x: i16, y: i16, width: i16, height: i16) -> bool
pub fn draw_point(&mut self, x: i16, y: i16, pixel: Pixel) -> bool
pub fn draw_line(
&mut self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
pixel: Pixel,
line: Line
) -> bool
pub fn draw_rect(
&mut self,
x: i16,
y: i16,
width: i16,
height: i16,
pixel: Pixel,
fill: bool,
line: Line
) -> bool
pub fn draw_circle(
&mut self,
x: i16,
y: i16,
radius: i16,
pixel: Pixel,
fill: bool
) -> bool
pub fn draw_string(
&mut self,
x: i16,
y: i16,
font: Font,
pixel: Pixel,
string: String
) -> bool
pub fn draw_string_align(
&mut self,
x_start: i16,
x_end: i16,
y: i16,
align: Align,
font: Font,
pixel: Pixel,
string: String
) -> bool
pub fn draw_image(
&mut self,
x: i16,
y: i16,
width: i16,
height: i16,
vec_image: Vec<u8>
) -> bool
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