Skip to content
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

limited discovery is not working anymore because of observer mode #80

Open
3 tasks done
floitsch opened this issue Nov 27, 2024 · 1 comment
Open
3 tasks done

Comments

@floitsch
Copy link

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

When scanning with .limited set to true I don't expect to see advertisements that are general.

Actual behavior (suspected bug)

Advertisements of general discoverability are accepted.

Error logs or terminal output

No response

Steps to reproduce the behavior

In 9faf23c support for the observer role was added.
In that commit the following lines were added:

if (MYNEWT_VAL(BLE_ROLE_OBSERVER)) {
/* Observer role is enabled; All adv reports regardless of
* Flags AD Type need to be discovered.
*/
return 0;
}

Since BLE_ROLE_OBSERVER is enabled by default, this basically breaks the limited flag (for which the test is just a few lines later).

if (ble_gap_master.disc.limited) {
if (rc != 0) {
/* The advertisement does not have Flags AD Type. Rejected */
return -1;
} else if ((flags->length == 2) && !(flags->value[0] & BLE_HS_ADV_F_DISC_LTD)) {
/* Limited flag is not set in Flags AD Type. Rejected */
return -1;
}

Maybe this is the intended behavior, but it is not clear from the description of the observer role flag that it should have an impact on the normal observation of the central. (At least it broke our unit tests)

Project release version

master

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Linux

Operating system version

Archlinux

Shell

ZSH

Additional context

No response

@rahult-github
Copy link
Collaborator

Hi @floitsch , thanks for pointing this out. We will fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants