diff options
author | Daniel Winkler <danielwinkler@google.com> | 2020-10-29 16:06:19 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-10-29 17:45:21 -0700 |
commit | f63c569f971ba9c6f028a9c8bf68be300efbba94 (patch) | |
tree | d5481d835847b8d65534d235e7f4fa10705e3c48 /tools/btmgmt.c | |
parent | cf7795a6ad50ab379bb6a0dceff2b0dc99ed5456 (diff) | |
download | bluez-f63c569f971ba9c6f028a9c8bf68be300efbba94.tar.gz |
advertising: Query LE TX range at manager initialization
This patch calls the new MGMT command to get controller capabilities,
and parses the min and max LE tx power range when the manager is
initialized. This will be used to populate a client-facing dbus entry so
that the client will know the advertising capabilities of the controller
before registering an advertisement.
This patch is tested by manually verifying the data is parsed correctly
from the MGMT response.
Diffstat (limited to 'tools/btmgmt.c')
-rw-r--r-- | tools/btmgmt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/btmgmt.c b/tools/btmgmt.c index b0b837d34..2f7cb2efc 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -1518,7 +1518,7 @@ static void cmd_extinfo(int argc, char **argv) static void sec_info_rsp(uint8_t status, uint16_t len, const void *param, void *user_data) { - const struct mgmt_rp_read_security_info *rp = param; + const struct mgmt_rp_read_controller_cap *rp = param; uint16_t index = PTR_TO_UINT(user_data); if (status != 0) { @@ -1533,7 +1533,7 @@ static void sec_info_rsp(uint8_t status, uint16_t len, const void *param, } print("Primary controller (hci%u)", index); - print("\tSecurity info length: %u", le16_to_cpu(rp->sec_len)); + print("\tSecurity info length: %u", le16_to_cpu(rp->cap_len)); done: pending_index--; @@ -1576,11 +1576,11 @@ static void sec_index_rsp(uint8_t status, uint16_t len, const void *param, if (rp->entry[i].type != 0x00) continue; - if (!mgmt_send(mgmt, MGMT_OP_READ_SECURITY_INFO, + if (!mgmt_send(mgmt, MGMT_OP_READ_CONTROLLER_CAP, index, 0, NULL, sec_info_rsp, UINT_TO_PTR(index), NULL)) { - error("Unable to send read_security_info cmd"); - return bt_shell_noninteractive_quit(EXIT_FAILURE); + error("Unable to send read_security_info cmd"); + return bt_shell_noninteractive_quit(EXIT_FAILURE); } pending_index++; } @@ -1602,7 +1602,7 @@ static void cmd_secinfo(int argc, char **argv) return; } - if (!mgmt_send(mgmt, MGMT_OP_READ_SECURITY_INFO, mgmt_index, 0, NULL, + if (!mgmt_send(mgmt, MGMT_OP_READ_CONTROLLER_CAP, mgmt_index, 0, NULL, sec_info_rsp, UINT_TO_PTR(mgmt_index), NULL)) { error("Unable to send read_security_info cmd"); |