pub struct Platform { /* private fields */ }Expand description
Access to platform services
See the platform module documentation for more context and information.
Implementations§
Source§impl Platform
Access to the platform services
impl Platform
Access to the platform services
Sourcepub async fn protocol_version(&self) -> Result<u8>
pub async fn protocol_version(&self) -> Result<u8>
Fetch the protocol version from Crazyflie
The protocol version is updated when new message or breaking change are implemented in the protocol. see the crate documentation for more information.
Compatibility is checked at connection time.
Sourcepub async fn firmware_version(&self) -> Result<String>
pub async fn firmware_version(&self) -> Result<String>
Fetch the firmware version
If this firmware is a stable release, the release name will be returned for example 2021.06.
If this firmware is a git build, between releases, the number of commit since the last release will be added
for example 2021.06 +128.
Sourcepub async fn device_type_name(&self) -> Result<String>
pub async fn device_type_name(&self) -> Result<String>
Fetch the device type.
The Crazyflie firmware can run on multiple device. This function returns the name of the device. For example
Crazyflie 2.1 is returned in the case of a Crazyflie 2.1.
Sourcepub async fn get_app_channel(
&self,
) -> Option<(impl Sink<AppChannelPacket> + use<>, impl Stream<Item = AppChannelPacket> + use<>)>
pub async fn get_app_channel( &self, ) -> Option<(impl Sink<AppChannelPacket> + use<>, impl Stream<Item = AppChannelPacket> + use<>)>
Get sender and receiver to the app channel
This function returns the transmit and receive channel to and from
the app channel. The channel accepts and generates AppChannelPacket
which guarantees that the packet length is correct. the From trait is
implemented to all possible [u8; n] and TryFrom to Vec
Sourcepub async fn set_cont_wave(&self, activate: bool) -> Result<()>
pub async fn set_cont_wave(&self, activate: bool) -> Result<()>
Set radio in continious wave mode
If activate is set to true, the Crazyflie’s radio will transmit a continious wave at the current channel frequency. This will be active until the Crazyflie is reset or this function is called with activate to false.
Setting continious wave will:
- Disconnect the radio link. So this function should practically only be used when connected over USB
- Jam any radio running on the same frequency, this includes Wifi and Bluetooth
As such, this shall only be used for test purpose in a controlled environment.
Sourcepub async fn send_arming_request(&self, do_arm: bool) -> Result<()>
pub async fn send_arming_request(&self, do_arm: bool) -> Result<()>
Send system arm/disarm request
Arms or disarms the Crazyflie’s safety systems. When disarmed, the motors will not spin even if thrust commands are sent.
§Arguments
do_arm- true to arm, false to disarm
Sourcepub async fn send_crash_recovery_request(&self) -> Result<()>
pub async fn send_crash_recovery_request(&self) -> Result<()>
Send crash recovery request
Requests recovery from a crash state detected by the Crazyflie.