adafruit-ble-fs-client

Crates.ioadafruit-ble-fs-client
lib.rsadafruit-ble-fs-client
version0.1.2
sourcesrc
created_at2023-02-21 15:34:52.429268
updated_at2023-03-05 21:04:46.259871
descriptionA client-side implementation of the Adafruit BLE file transfer protocol
homepage
repositoryhttps://gitlab.com/jensstein/adafruit-ble-file-transfer-client-rs
max_upload_size
id790804
size51,250
(jensstein)

documentation

README

Adafruit BLE file transfer client library

crates.io Released API docs MIT licensed CI coverage

Client-side implementation of the Adafruit BLE file transfer protocol

Provides a client-side interface to interact with a device which exposes files with the Adafruit BLE file transfer protocol. The protocol is documented here: https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer#protocol

This library is designed to enable you to bring your own bluetooth handler by implementing the adafruit_ble_fs_client::device::Device trait. Or you can use the implementations in the adafruit_ble_fs_client::providers module.

Example

use adafruit_ble_fs_client::AdafruitFileTransferClient;
use adafruit_ble_fs_client::providers::btleplug_provider::BtleplugDevice;

#[tokio::main]
async fn main() {
    let client = AdafruitFileTransferClient::<BtleplugDevice>::new_from_device_name("device-name")
        .await
        .unwrap();
    let version = client.get_version().await
        .unwrap();
    println!("Your client is running adafruit ble-fs version {version:?}");
    let files = client.list_directory("/").await.expect("Unable to list directory /");
    println!("Files in /: {files:?}");
}
Commit count: 22

cargo fmt