summaryrefslogtreecommitdiffstats
path: root/ble/src
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-09-09 20:15:21 -0400
committerBrian Cully <bjc@kublai.com>2019-09-09 20:45:08 -0400
commitc1422f40d1ec9f77cc72c9425e67e97150bb2f52 (patch)
treec1756087df282369ba856b1c384ef061af12f63e /ble/src
parentfdd4cfd1eb4995c192184aaa6ff073cee50852cb (diff)
downloadbleusb-c1422f40d1ec9f77cc72c9425e67e97150bb2f52.tar.gz
bleusb-c1422f40d1ec9f77cc72c9425e67e97150bb2f52.zip
Convert to workspace.
Diffstat (limited to 'ble/src')
-rw-r--r--ble/src/ble.rs12
1 files changed, 9 insertions, 3 deletions
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::<NRF52840>::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,