rust-esp32-std-demo icon indicating copy to clipboard operation
rust-esp32-std-demo copied to clipboard

Add Bluetooth BLE scan example

Open svenstaro opened this issue 3 years ago • 3 comments

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.

svenstaro avatar May 17 '22 02:05 svenstaro

@ivmarkov I have no idea why this fails to build for this target. For xtensa-esp32-espidf it works just fine. Any idea?

svenstaro avatar May 17 '22 03:05 svenstaro

Hi ! I tried to fix the problem with esp32c3 in your PR on my own fork, you should be able to see it there.

pyaillet avatar Jun 24 '22 20:06 pyaillet

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();
    }

kauly avatar Sep 22 '22 15:09 kauly

image

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

cwoolum avatar Oct 25 '22 05:10 cwoolum

Closing in favor of https://github.com/esp-rs/esp-idf-svc/pull/247.

svenstaro avatar Apr 20 '23 20:04 svenstaro