Struct GoPro

Source
pub struct GoPro { /* private fields */ }
Expand description

Represents a connected GoPro device

Implementations§

Source§

impl GoPro

Source

pub async fn send_command_unchecked( &self, command: &GoProCommand, ) -> Result<(), Box<dyn Error>>

Sends a command to the GoPro without checking for a response

§Arguments
  • command - The command to send to the GoPro
Source

pub async fn send_command( &self, command: &GoProCommand, ) -> Result<(), Box<dyn Error>>

Sends a command to the GoPro and checks for a response, erroring if the response is incorrect

§Arguments
  • command - The command to send to the GoPro
Source

pub async fn send_setting_unchecked( &self, setting: &GoProSetting, ) -> Result<(), Box<dyn Error>>

Sends a setting to the GoPro without checking for a response

§Arguments
  • setting - The setting to send to the GoPro
Source

pub async fn send_setting( &self, setting: &GoProSetting, ) -> Result<(), Box<dyn Error>>

Sends a setting to the GoPro and checks for a response, erroring if the response is incorrect

§Arguments
  • setting - The setting to send to the GoPro
Source

pub async fn query( &self, query: &GoProQuery, ) -> Result<QueryResponse, Box<dyn Error>>

Sends a query to the GoPro and returns the response

§Arguments
  • query - The query to send to the GoPro
Source

pub async fn get_next_notification( &self, ) -> Result<Option<ValueNotification>, Box<dyn Error>>

Gets the next notification (response from a command) from the GoPro

§Returns
  • Ok(Some(ValueNotification)) - If a notification was received
  • Ok(None) - If no notification was received
  • Err(Box<dyn Error>) - If an error occurred
Source

pub async fn disconnect(self) -> Result<(), Box<dyn Error>>

Disconnects the GoPro

Source

pub async fn disconnect_and_poweroff(self) -> Result<(), Box<dyn Error>>

Disconnects the GoPro and powers it off

§Note

The camera will continue to send advertisement packets for 10 hours after being powered off allowing for an auto wake on reconnecting

Auto Trait Implementations§

§

impl Freeze for GoPro

§

impl !RefUnwindSafe for GoPro

§

impl Send for GoPro

§

impl Sync for GoPro

§

impl Unpin for GoPro

§

impl !UnwindSafe for GoPro

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.