rust-esp32-std-demo
rust-esp32-std-demo copied to clipboard
Add Bluetooth BLE scan example
This adds an example for BLE scanning. It doesn't actually set up any GATTs nor does it actually connect via Bluetooth to anything. It merely scans its surroundings for 2 seconds and then continues with the rest of the demo as everything else seemed to verbose to me. I think this is about the simplest Bluetooth example one can currently get away with.
I think this also shows a clear way for how some of the more obvious things could be upstreamed into esp_idf_svc in order to streamline usage in the most common cases. It's a start and I hope it inspires some people to maybe carry the torch. :)
Fixes #85.
@ivmarkov I have no idea why this fails to build for this target. For xtensa-esp32-espidf it works just fine. Any idea?
Hi !
I tried to fix the problem with esp32c3 in your PR on my own fork, you should be able to see it there.
To make the bluetooth() function work I had to put the following piece of code at main.rs:
unsafe {
esp_idf_sys::nvs_flash_init();
}

I'm getting an error that many of the fields on esp_bt_controller_config_t don't exist.
EDIT: @pyaillet 's branch worked for me
Closing in favor of https://github.com/esp-rs/esp-idf-svc/pull/247.