Skip to content

BLE recycled callback not called #83865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
szymonwid opened this issue Jan 12, 2025 · 3 comments
Closed

BLE recycled callback not called #83865

szymonwid opened this issue Jan 12, 2025 · 3 comments
Assignees
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale

Comments

@szymonwid
Copy link

szymonwid commented Jan 12, 2025

Describe the bug

Hi, in my project I am using BLE as a peripheral role. It has custom service with few characteristics with notify property. When I connect to the central, enable notifications on any characteristic and then disconnect, recycled callback is never called and advertising is not started again. It is happening if BLE task has ~<15ms period and bt_gatt_notify() function is called inside. Increasing BLE task period to 100ms fixed that, but I am still afraid that it may still happend in field. The same happens on ble peripheral sample if BLE task period is shortened from 1s to 10ms. I am using nucleo_f446re board and Samsung Galaxy S23 as a central.

To Reproduce

  1. Change BLE task period in zephyr\samples\bluetooth\peripheral\src\main.c:379 from 1s to 10ms and remove _ONE_TIME from advertising options in zephyr\samples\bluetooth\peripheral\src\main.c:277
  2. Build and flash application.
  3. Connect to the device with the phone.
  4. Set Battery Level notification on in Battery Service.
  5. Disconnect.
  6. Check if advertising is restarted (repeat if it is advertising, it's not 100% reproducable)

Expected behavior

Impact

Logs and console output

Environment (please complete the following information):

  • OS: (e.g. Linux, MacOS, Windows)
  • Toolchain (e.g Zephyr SDK, ...)
  • Commit SHA or Version used

Additional context

@szymonwid szymonwid added the bug The issue is a bug, or the PR is fixing a bug label Jan 12, 2025
Copy link

Hi @szymonwid! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@fabocode
Copy link
Contributor

fabocode commented Feb 3, 2025

Hi @szymonwid thank you for reporting this issue.

I took the time to reproduce this issue, but I am not being able to get the same results as you. Can you please provide more detailed information?

I am working from master branch in zephyr/samples/bluetooth/peripheral sample, I provided the recycle callback function, called the advertisement start function inside the recycle function, and tested by reducing the ble task from main() function from 1s to 1-15ms but every time the recycled callback is successfully called.

Maybe you can try with the latest changes made in master and check if the issue persists. If you can share more code, can be also help!

Copy link

github-actions bot commented Apr 5, 2025

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Apr 5, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale
Projects
None yet
Development

No branches or pull requests

6 participants