Merge pull request 'Menambah keterangan sistem operasi yang didukung' (#21) from pengembangan into main
Reviewed-on: #21
This commit was merged in pull request #21.
This commit is contained in:
commit
6f9ac2f9e3
5 files changed
+19
-7
No files matched your search
+8
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-bluclas"
|
name = "tauri-plugin-bluclas"
|
||||||
version = "0.1.15"
|
version = "0.1.16"
|
||||||
authors = [ "Rizky Denianto" ]
|
authors = [ "Rizky Denianto" ]
|
||||||
description = "Program sederhana untuk interaksi dengan bluetooth classic"
|
description = "Program sederhana untuk interaksi dengan bluetooth classic"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
@@ -17,6 +17,13 @@ incremental = false
|
|||||||
strip = "symbols"
|
strip = "symbols"
|
||||||
debug = false
|
debug = false
|
||||||
|
|
||||||
|
[package.metadata.platforms.support]
|
||||||
|
windows = { level = "full" }
|
||||||
|
linux = { level = "full" }
|
||||||
|
macos = { level = "none" }
|
||||||
|
android = { level = "full" }
|
||||||
|
ios = { level = "none" }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri = { version = "2.11.5" }
|
tauri = { version = "2.11.5" }
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
|
|||||||
@@ -90,9 +90,13 @@ class BluclasPlugin(private val activity: Activity) : Plugin(activity) {
|
|||||||
@Command
|
@Command
|
||||||
fun kirim(invoke: Invoke) {
|
fun kirim(invoke: Invoke) {
|
||||||
val args = invoke.parseArgs(KirimArgs::class.java)
|
val args = invoke.parseArgs(KirimArgs::class.java)
|
||||||
|
if (args.alamat.isNullOrEmpty()) {
|
||||||
|
invoke.resolve()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
menghubungkanKoneksi(args.alamat ?: "")
|
menghubungkanKoneksi(args.alamat)
|
||||||
|
|
||||||
if (keluaran == null) {
|
if (keluaran == null) {
|
||||||
throw Exception("Tidak ada perangkat yang terhubung")
|
throw Exception("Tidak ada perangkat yang terhubung")
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@segubi/tauri-plugin-bluclas-api",
|
"name": "@segubi/tauri-plugin-bluclas-api",
|
||||||
"version": "0.1.15",
|
"version": "0.1.16",
|
||||||
"author": "Rizky Denianto",
|
"author": "Rizky Denianto",
|
||||||
"description": "Program sederhana untuk interaksi dengan bluetooth classic",
|
"description": "Program sederhana untuk interaksi dengan bluetooth classic",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,3 @@
|
|||||||
use crate::commands::{daftar_perangkat, kirim};
|
|
||||||
use tauri::{
|
use tauri::{
|
||||||
Manager, Runtime,
|
Manager, Runtime,
|
||||||
plugin::{Builder, TauriPlugin},
|
plugin::{Builder, TauriPlugin},
|
||||||
@@ -22,6 +21,8 @@ use desktop::Bluclas;
|
|||||||
#[cfg(mobile)]
|
#[cfg(mobile)]
|
||||||
use mobile::Bluclas;
|
use mobile::Bluclas;
|
||||||
|
|
||||||
|
use crate::commands::{daftar_perangkat, kirim};
|
||||||
|
|
||||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the bluclas APIs.
|
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the bluclas APIs.
|
||||||
pub trait BluclasExt<R: Runtime> {
|
pub trait BluclasExt<R: Runtime> {
|
||||||
fn bluclas(&self) -> &Bluclas<R>;
|
fn bluclas(&self) -> &Bluclas<R>;
|
||||||
|
|||||||
+3
-3
@@ -1,19 +1,19 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SDaftarPerangkatBlueclasResponDaftarPerangkat {
|
pub struct SDaftarPerangkatBlueclasResponDaftarPerangkat {
|
||||||
pub nama: String,
|
pub nama: String,
|
||||||
pub alamat: String,
|
pub alamat: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SBlueclasResponDaftarPerangkat {
|
pub struct SBlueclasResponDaftarPerangkat {
|
||||||
pub data: Vec<SDaftarPerangkatBlueclasResponDaftarPerangkat>,
|
pub data: Vec<SDaftarPerangkatBlueclasResponDaftarPerangkat>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SBlueclasMuatanKirim {
|
pub struct SBlueclasMuatanKirim {
|
||||||
pub alamat: String,
|
pub alamat: String,
|
||||||
|
|||||||
Reference in new issue
Block a user