pub struct A8Mini {
pub command_socket: UdpSocket,
pub http_socket: UdpSocket,
}Expand description
Represents the A8Mini camera API with a dedicate UDP socket for both Commands and HTTPQuerys.
Fields§
§command_socket: UdpSocket§http_socket: UdpSocketImplementations§
Source§impl A8Mini
impl A8Mini
Sourcepub async fn connect() -> Result<Self>
pub async fn connect() -> Result<Self>
Connect to and creates a new A8Mini using default ip address 192.168.144.25 and default port 37260 and port 82.
Remote ports are mapped to port 8080 and port 8088 on local.
Sourcepub async fn connect_yapping(max_iter: i32) -> Result<Self>
pub async fn connect_yapping(max_iter: i32) -> Result<Self>
Repeatedly tries to reconnect a total of `max_iter`` times
Sourcepub async fn connect_to(
camera_ip: &str,
camera_command_port: &str,
camera_http_port: &str,
local_command_port: &str,
local_http_port: &str,
) -> Result<Self>
pub async fn connect_to( camera_ip: &str, camera_command_port: &str, camera_http_port: &str, local_command_port: &str, local_http_port: &str, ) -> Result<Self>
Connects to and creates a new A8Mini given network args.
Sourcepub async fn send_command_blind<T: Command>(&self, command: T) -> Result<()>
pub async fn send_command_blind<T: Command>(&self, command: T) -> Result<()>
Sends a control::Command blind. This should be used for all commands that don’t have a ACK.
Sourcepub async fn send_command<T: Command>(&self, command: T) -> Result<[u8; 64]>
pub async fn send_command<T: Command>(&self, command: T) -> Result<[u8; 64]>
Sends a control::Command expecting an ACK. Returns received ACK response bytes.
Sourcepub async fn get_attitude_information(&self) -> Result<A8MiniAttitude>
pub async fn get_attitude_information(&self) -> Result<A8MiniAttitude>
Retrieves attitude information from the camera.
pub fn stream_attitude_data(self, target_hz: u64) -> Receiver<A8MiniAttitude>
pub async fn get_firmware_version(&self) -> Result<A8MiniFirmwareVersion>
Sourcepub async fn send_http_query<T: HTTPQuery>(
&self,
query: T,
) -> Result<HTTPResponse>
pub async fn send_http_query<T: HTTPQuery>( &self, query: T, ) -> Result<HTTPResponse>
Sends a control::HTTPQuery and returns the corresponding received control::HTTPResponse.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for A8Mini
impl RefUnwindSafe for A8Mini
impl Send for A8Mini
impl Sync for A8Mini
impl Unpin for A8Mini
impl UnsafeUnpin for A8Mini
impl UnwindSafe for A8Mini
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more