https://github.com/dreaming-codes/tauri-plugin-btleplug
This is a simple plugin to get btleplug to work with tauri, simply add this plugin and use btleplug as normal
https://github.com/dreaming-codes/tauri-plugin-btleplug
Last synced: 9 months ago
JSON representation
This is a simple plugin to get btleplug to work with tauri, simply add this plugin and use btleplug as normal
- Host: GitHub
- URL: https://github.com/dreaming-codes/tauri-plugin-btleplug
- Owner: Dreaming-Codes
- Created: 2024-06-14T20:10:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-17T23:11:40.000Z (over 1 year ago)
- Last Synced: 2025-04-02T18:55:31.742Z (9 months ago)
- Language: Java
- Homepage:
- Size: 713 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tauri Plugin btleplug
add to your `proguard-rules.pro` file:
```proguard
#btleplug resources
-keep class com.nonpolynomial.** { *; }
-keep class io.github.gedgygedgy.** { *; }
```
btleplug functions need to be called on the btleplug adhoc runtime:
```rust
#[tauri::command]
async fn your_cool_tauri_command(app_handle: tauri::AppHandle) -> Result<(), ()> {
app_handle.btleplug().btleplug_context_spawn(async move {
// your btleplug code here
}).await.expect("error during btleplug task");
Ok(())
}
```
### Supported platforms:
- [x] Windows
- [x] Linux
- [ ] MacOS (https://github.com/deviceplug/btleplug/tree/master?tab=readme-ov-file#macos)
- [x] Android
- [ ] iOS (may work, not tested)
- [ ] Web ([not yet supported by btleplug](https://github.com/deviceplug/btleplug/tree/master?tab=readme-ov-file#platform-status))
Basically this plugin only init btleplug for android, other platforms does not require additional setup to use btleplug so if you do not need android support you can just use btleplug directly.