Skip to content

Commit

Permalink
update trouble version
Browse files Browse the repository at this point in the history
  • Loading branch information
lulf committed Aug 26, 2024
1 parent 4375d5a commit c5b6179
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
17 changes: 7 additions & 10 deletions examples/src/bin/wifi_embassy_trouble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -111,7 +108,7 @@ async fn main(_s: Spawner) {
)
.unwrap();

let server = ble.gatt_server(&table);
let server = ble.gatt_server::<NoopRawMutex, 10, 256>(&table);

info!("Starting advertising and GATT service");
// Run all 3 tasks in a join. They can also be separate embassy tasks.
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit c5b6179

Please sign in to comment.