From c5b61792a6d312a0a1e6a11eb87ce76fd3c456c8 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 26 Aug 2024 18:40:22 +0200 Subject: [PATCH] update trouble version --- examples/Cargo.toml | 2 +- examples/src/bin/wifi_embassy_trouble.rs | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index a171eb91188..6b45e344de0 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -56,7 +56,7 @@ smart-leds = "0.4.0" smoltcp = { version = "0.11.0", default-features = false, features = [ "medium-ethernet", "socket-raw"] } ssd1306 = "0.8.4" static_cell = { version = "2.1.0", features = ["nightly"] } -trouble-host = { git = "https://github.com/embassy-rs/trouble", package = "trouble-host", rev = "75dc087edde312eb1c2fa49dd57b5c16e00ff26b", features = [ "log", "gatt" ] } +trouble-host = { git = "https://github.com/embassy-rs/trouble", package = "trouble-host", rev = "4f1114ce58e96fe54f5ed7e726f66e1ad8d9ce54", features = [ "log", "gatt" ] } usb-device = "0.3.2" usbd-serial = "0.2.2" diff --git a/examples/src/bin/wifi_embassy_trouble.rs b/examples/src/bin/wifi_embassy_trouble.rs index d5ae8616471..3f59bd7bf0f 100644 --- a/examples/src/bin/wifi_embassy_trouble.rs +++ b/examples/src/bin/wifi_embassy_trouble.rs @@ -91,14 +91,11 @@ async fn main(_s: Spawner) { table.add_service(Service::new(0x1801)); // Battery service - let bat_level_handle = table - .add_service(Service::new(0x180f)) - .add_characteristic( - 0x2a19, - &[CharacteristicProp::Read, CharacteristicProp::Notify], - &mut bat_level, - ) - .build(); + let bat_level_handle = table.add_service(Service::new(0x180f)).add_characteristic( + 0x2a19, + &[CharacteristicProp::Read, CharacteristicProp::Notify], + &mut bat_level, + ); let mut adv_data = [0; 31]; AdStructure::encode_slice( @@ -111,7 +108,7 @@ async fn main(_s: Spawner) { ) .unwrap(); - let server = ble.gatt_server(&table); + let server = ble.gatt_server::(&table); info!("Starting advertising and GATT service"); // Run all 3 tasks in a join. They can also be separate embassy tasks. @@ -154,7 +151,7 @@ async fn main(_s: Spawner) { Timer::after(Duration::from_secs(1)).await; tick = tick.wrapping_add(1); server - .notify(bat_level_handle, &conn, &[tick]) + .notify(&ble, bat_level_handle, &conn, &[tick]) .await .unwrap(); }