Skip to content

Commit cc25df7

Browse files
committed
Changelog
1 parent 7337b89 commit cc25df7

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
- Rearrange LED display modules under the same root module and change their
1111
APIs to be more aligned with each other.
12+
- Add BLE Beacon demo.
1213

1314
## [0.10.1] - 2021-05-25
1415

@@ -35,7 +36,7 @@ Republished without changes to fix missing README.md in crates.io.
3536
- Fix rustdoc warnings
3637
- Upgrade nrf51-hal to 0.12.1
3738

38-
[Unreleased]: https://github.com/nrf-rs/microbit/compare/v0.10.1...HEAD
39+
[unreleased]: https://github.com/nrf-rs/microbit/compare/v0.10.1...HEAD
3940
[0.10.1]: https://github.com/nrf-rs/microbit/releases/tag/v0.10.0...v0.10.1
4041
[0.10.0]: https://github.com/nrf-rs/microbit/releases/tag/v0.9.0...v0.10.0
4142
[0.9.0]: https://github.com/nrf-rs/microbit/compare/v0.8.0...v0.9.0

examples/ble-beacon/src/main.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![no_main]
22
#![no_std]
33

4+
use defmt_rtt as _;
45
use panic_halt as _;
56

67
use cortex_m_rt::entry;
@@ -30,17 +31,20 @@ fn main() -> ! {
3031
let mut timer = Timer::new(p.TIMER0);
3132

3233
loop {
33-
defmt::info!("Local name");
34+
// Broadcast local name
35+
let local_name = "Rusty microbit";
36+
defmt::info!("Local name: {}", local_name);
3437
let beacon = Beacon::new(
3538
device_address,
36-
&[AdStructure::CompleteLocalName("Rusty microbit")],
39+
&[AdStructure::CompleteLocalName(local_name)],
3740
)
3841
.unwrap();
3942
beacon.broadcast(&mut radio);
40-
timer.delay_ms(1_000_u16);
43+
timer.delay_ms(100_u16);
4144

45+
// Broadcast data
4246
let data = "Hello world";
43-
defmt::info!("{}", data);
47+
defmt::info!("Data: {}", data);
4448
let beacon = Beacon::new(
4549
device_address,
4650
&[AdStructure::ManufacturerSpecificData {
@@ -50,7 +54,7 @@ fn main() -> ! {
5054
)
5155
.unwrap();
5256
beacon.broadcast(&mut radio);
53-
timer.delay_ms(1_000_u16);
57+
timer.delay_ms(500_u16);
5458
}
5559
}
5660

0 commit comments

Comments
 (0)