-
Notifications
You must be signed in to change notification settings - Fork 383
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
base: master
Are you sure you want to change the base?
host: Add support for LE Set Data Related Address change command #1599
Conversation
@sjanc , please take a look |
Hi, Could you rebase so that CI tests kick in? |
a35450a
to
3236091
Compare
Yes . done now. |
3236091
to
49d987a
Compare
49d987a
to
dfc33dc
Compare
@sjanc , can you please take a look as have rebased the PR. |
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. |
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); |
There was a problem hiding this comment.
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.
Add API to send LE Set Data related Address change HCI command