Menghubungkan kotlin dengan rust
This commit is contained in:
+13
-6
@@ -1,13 +1,20 @@
|
||||
use tauri::{AppHandle, command, Runtime};
|
||||
use tauri::{command, AppHandle, Runtime};
|
||||
|
||||
use crate::models::*;
|
||||
use crate::Result;
|
||||
use crate::BluclasExt;
|
||||
use crate::Result;
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn ping<R: Runtime>(
|
||||
pub(crate) async fn daftar_perangkat<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
payload: PingRequest,
|
||||
) -> Result<PingResponse> {
|
||||
app.bluclas().ping(payload)
|
||||
) -> Result<Vec<SBluetoothClassicResponPerangkat>> {
|
||||
return app.bluclas().daftar_perangkat();
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn kirim<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
payload: SBluetoothClassicMuatanKirim,
|
||||
) -> Result<()> {
|
||||
return app.bluclas().kirim(payload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user