From c1422f40d1ec9f77cc72c9425e67e97150bb2f52 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 9 Sep 2019 20:15:21 -0400 Subject: Convert to workspace. --- ble/src/ble.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ble/src') diff --git a/ble/src/ble.rs b/ble/src/ble.rs index ac3542f..04d8687 100644 --- a/ble/src/ble.rs +++ b/ble/src/ble.rs @@ -7,11 +7,12 @@ use rubble::{ gatt::BatteryServiceAttrs, l2cap::{BleChannelMap, L2CAPState}, link::{ - ad_structure::AdStructure, queue, AddressKind, DeviceAddress, HardwareInterface, LinkLayer, - Responder, MIN_PDU_BUF, + ad_structure::{AdStructure, ServiceUuids}, + queue, AddressKind, DeviceAddress, HardwareInterface, LinkLayer, Responder, MIN_PDU_BUF, }, security_manager::NoSecurity, time::{Duration, Timer}, + uuid::Uuid, }; use rubble_nrf52::{ radio::{BleRadio, PacketBuffer}, @@ -76,11 +77,16 @@ pub fn setup( // may be able to use ring buffer to avoid sharing? let mut ble_radio = unsafe { BleRadio::new(radio, &mut TX_BUF, &mut RX_BUF) }; + let uart_uuid = + Uuid::parse_str("6E400001-B5A3-F393-E0A9-E50E24DCCA9E").expect("parsing UART UUID"); let mut ble_ll = LinkLayer::::new(addr, ble_timer); let next_update = ble_ll .start_advertise( Duration::from_millis(200), - &[AdStructure::CompleteLocalName("bleusb")], + &[ + AdStructure::CompleteLocalName("bleusb"), + AdStructure::ServiceUuids128(ServiceUuids::from_uuids(true, &[uart_uuid])), + ], &mut ble_radio, tx_cons, rx_prod, -- cgit v1.2.3