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, Box<dyn Error>>
pub async fn connect() -> Result<Self, Box<dyn Error>>
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.
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<A8Mini, Box<dyn Error>>
Sourcepub async fn send_command_blind<T: Command>(
&self,
command: T,
) -> Result<(), Box<dyn Error>>
pub async fn send_command_blind<T: Command>( &self, command: T, ) -> Result<(), Box<dyn Error>>
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], Box<dyn Error>>
pub async fn send_command<T: Command>( &self, command: T, ) -> Result<[u8; 64], Box<dyn Error>>
Sends a control::Command expecting an ACK. Returns received ACK response bytes.
Sourcepub async fn get_attitude_information(
&self,
) -> Result<A8MiniAtittude, Box<dyn Error>>
pub async fn get_attitude_information( &self, ) -> Result<A8MiniAtittude, Box<dyn Error>>
Retrieves attitude information from the camera. Can be used as a system connectivity check.
Sourcepub async fn send_http_query<T: HTTPQuery>(
&self,
query: T,
) -> Result<HTTPResponse, Box<dyn Error>>
pub async fn send_http_query<T: HTTPQuery>( &self, query: T, ) -> Result<HTTPResponse, Box<dyn Error>>
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 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