Closed HaoboGu closed 4 months ago
fixed by:
if let Err(e) = ble_advertising.lock().scan_response(false).set_data(
BLEAdvertisementData::new()
.name(keyboard_name)
.appearance(0x03C1)
.add_service_uuid(hid.hid_service().lock().uuid()),
) {
error!("BLE advertising error, error code: {}", e.code());
}
if let Err(e) = ble_advertising.lock().start() {
error!("BLE advertising start error: {}", e.code());
}
I'm using esp32c3 as a ble keyboard using esp32-nimble, but it failed to advertise. The full log is :
And my advertising code is:
As you can see, the code stop at
ble_advertising
, I suspect that it failed to acquire the lock, but I don't know why. Anyone has ideas? Thanks!