Crates.io | adafruit-ble-fs-client |
lib.rs | adafruit-ble-fs-client |
version | 0.1.2 |
source | src |
created_at | 2023-02-21 15:34:52.429268 |
updated_at | 2023-03-05 21:04:46.259871 |
description | A client-side implementation of the Adafruit BLE file transfer protocol |
homepage | |
repository | https://gitlab.com/jensstein/adafruit-ble-file-transfer-client-rs |
max_upload_size | |
id | 790804 |
size | 51,250 |
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:?}");
}