Struct gopro_controller::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 !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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.