Crates.io | bluerepl |
lib.rs | bluerepl |
version | 0.1.7 |
source | src |
created_at | 2022-11-02 23:21:41.434139 |
updated_at | 2022-11-18 00:04:55.931114 |
description | A ble client running in the terminal |
homepage | |
repository | https://github.com/Yohannfra/bluerepl |
max_upload_size | |
id | 703821 |
size | 405,695 |
bluerepl is a command line application to interact with Bluetooth Low Energy (BLE) peripherals.
It works on Windows, Mac OS and Linux.
$ cargo install bluerepl
$ git clone https://github.com/Yohannfra/bluerepl
$ cargo build
$ cargo install --path .
Launch the application with the bleurepl command, once started it will display basic informations.
$ bluerepl
bleurepl Version: 0.1.2
Using BLE adapter: "CoreBluetooth"
>> ...
You can type help to see all available commands and their usages or a help text about a specific command.
>> help
COMMANDS:
clear Clear the terminal
connect Connect to a BLE peripheral
disconnect Disconnect from BLE peripheral
help Print this message or the help of the given subcommand(s)
indicate Subscribe to a characteristic indications and print it's value when it gets updated
info Print informations about a specified topic
notify Subscribe to a characteristic notifications and print it's value when it gets updated
preset Print preset informations or run preset commands/functions
quit Quit the REPL
read Read the value of a characteristic
scan Search for BLE devices around
unsubscribe Unsubscribe from the notifications or indications of a characteristic
write Write a value to a characteristic
>> help scan
Search for BLE devices around
USAGE:
scan [OPTIONS] [timeout]
ARGS:
<timeout> Time to scan in seconds [default: 5]
OPTIONS:
-a, --all Show unnamed peripheral
-h, --help Print help information
-l, --list Show last scan list (doesn't run a new scan)
...
A typical workflow would look like this:
>> scan # search for peripherals
Scanning for 5 seconds...
....
>> connect 12 # connect to peripheral with id 12 in scan list
Connected
>> info gatt # print all gatt, services and characteristics of the connected peripheral
...
>> read 0000180a-0000-1000-8000-00805f9b34fb 00002a24-0000-1000-8000-00805f9b34fb # read a characteristic value
[0xff, 0x32, 0x31 ...]
>> write 0000180a-0000-1000-8000-00805f9b34fb 00002a24-0000-1000-8000-00805f9b34fb "0x12 0x44" # write a characteristic value
>> disconnect # disconnect from device
>> quit # or CTRL+D
see LICENSE