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

host: Add support for LE Set Data Related Address change command #1599

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rahult-github
Copy link
Contributor

Add API to send LE Set Data related Address change HCI command

@rahult-github
Copy link
Contributor Author

@sjanc , please take a look

@sjanc
Copy link
Contributor

sjanc commented Sep 20, 2023

Hi,

Could you rebase so that CI tests kick in?

@rahult-github rahult-github force-pushed the feat/add_set_data_related_addr_change_cmd branch from a35450a to 3236091 Compare September 21, 2023 05:44
@rahult-github
Copy link
Contributor Author

Hi,

Could you rebase so that CI tests kick in?

Yes . done now.

@rahult-github rahult-github force-pushed the feat/add_set_data_related_addr_change_cmd branch from 3236091 to 49d987a Compare September 25, 2023 10:46
@rahult-github rahult-github force-pushed the feat/add_set_data_related_addr_change_cmd branch from 49d987a to dfc33dc Compare October 3, 2023 06:05
@rahult-github
Copy link
Contributor Author

@sjanc , can you please take a look as have rebased the PR.

@sjanc
Copy link
Contributor

sjanc commented Oct 10, 2023

Hi,

Why not put this configuration in advertising parameters and handle it there? Instead of adding dedicated API that just wraps HCI command

@rahult-github
Copy link
Contributor Author

Hi,

Why not put this configuration in advertising parameters and handle it there? Instead of adding dedicated API that just wraps HCI command

Thanks for the review. There is no harm in setting the reasons as part of advertising parameters and issuing this command.

But spec says "This command may be used while advertising is enabled". This gives a thought , that this HCI command can be invoked later on also with a reason code as per use case which may not be provided when advertising was enabled? A standalone usage of sending the HCI command is possible. That is why created a separate API. But please let me know if this understanding of mine is incorrect.

@sjanc
Copy link
Contributor

sjanc commented Nov 23, 2023

Hi,

sorry for late reply, fair enough, so this can be separated API but I'd make some changes to it to follow NimBLE API convention more closely (and bit more future proof)

*
* @return 0 on success; nonzero on failure.
*/
int ble_gap_set_data_related_addr_change_param(uint8_t adv_handle, uint8_t change_reason);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since behavior is different if legacy commands are used I'd split this into two separate APIs and make parameters name follow other adv api conventions:

struct ble_gap_adv_addr_change_params {
      unsigned int on_adv_data_change : 1;
      unsigned int on_scan_rsp_change : 1;
}

int ble_gap_ext_adv_set_data_related_addr_change(uint8_t instance,
                                                 const struct ble_gap_adv_addr_change_param *params);

int ble_gap_adv_set_data_related_addr_change(const struct ble_gap_adv_addr_change_param *params);

and put them under proper ifdef sections in headers and source code.
Legacy variant can skipped as it is unlikely to be used anyway with legacy HCI.

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

Successfully merging this pull request may close these issues.

None yet

2 participants