Skip to content

Commit

Permalink
Merge pull request #16 from akiles/spaghettify
Browse files Browse the repository at this point in the history
Update java-spaghetti to v0.2.
  • Loading branch information
alexmoon authored Apr 5, 2024
2 parents 7849c9b + 865e6f3 commit 39fd968
Show file tree
Hide file tree
Showing 4 changed files with 17,325 additions and 8,845 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ bluer = { version = "0.16.1", features = ["bluetoothd"] }
tokio = { version = "1.20.1", features = ["rt-multi-thread"] }

[target.'cfg(target_os = "android")'.dependencies]
java-spaghetti = "0.1.0"
java-spaghetti = "0.2.0"
async-channel = "2.2.0"

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
Expand Down
6 changes: 3 additions & 3 deletions src/android/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::task::{Context, Poll};
use async_channel::{Receiver, Sender};
use futures_core::Stream;
use futures_lite::{stream, StreamExt};
use java_spaghetti::{Arg, ByteArray, Env, Global, Local, PrimitiveArray, VM};
use java_spaghetti::{Arg, ByteArray, Env, Global, Local, Null, PrimitiveArray, VM};
use tracing::{debug, warn};
use uuid::Uuid;

Expand Down Expand Up @@ -86,13 +86,13 @@ impl AdapterImpl {
let settings = ScanSettings_Builder::new(env)?;
settings.setScanMode(ScanSettings::SCAN_MODE_LOW_LATENCY)?;
let settings = settings.build()?.non_null()?;
scanner.startScan_List_ScanSettings_ScanCallback(None, &*settings, &**callback)?;
scanner.startScan_List_ScanSettings_ScanCallback(Null, settings, callback)?;

let guard = defer(move || {
self.inner.manager.vm().with_env(|env| {
let callback = callback_global.as_ref(env);
let scanner = self.inner.le_scanner.as_ref(env);
match scanner.stopScan_ScanCallback(&**callback) {
match scanner.stopScan_ScanCallback(callback) {
Ok(()) => debug!("stopped scan"),
Err(e) => warn!("failed to stop scan: {:?}", e),
};
Expand Down
Loading

0 comments on commit 39fd968

Please sign in to comment.