This is an automated email from the ASF dual-hosted git repository. aguettouche pushed a commit to branch releases/10.0 in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 12e0f18b9ba9930254565181a5dcc0e9aa3dc2c3 Author: Matias N <[email protected]> AuthorDate: Wed Oct 28 23:47:58 2020 -0300 bt_hcicore.c: fix handling of advertising report; use correct advertising interval --- wireless/bluetooth/bt_hcicore.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c index 7e2a42d..9aadb37 100644 --- a/wireless/bluetooth/bt_hcicore.c +++ b/wireless/bluetooth/bt_hcicore.c @@ -791,7 +791,7 @@ done: static void le_adv_report(FAR struct bt_buf_s *buf) { - FAR struct bt_hci_ev_le_advertising_info_s *info; + FAR struct bt_hci_ev_le_advertising_report_s *info; uint8_t num_reports = buf->data[0]; wlinfo("Adv number of reports %u\n", num_reports); @@ -830,10 +830,14 @@ static void le_adv_report(FAR struct bt_buf_s *buf) /* Get next report iteration by moving pointer to right offset in buf * according to spec 4.2, Vol 2, Part E, 7.7.65.2. + * + * TODO: multiple reports are stored as multiple arrays not one array + * of structs. If num_reports > 0 this will not WORK! */ - info = bt_buf_consume(buf, - sizeof(*info) + info->length + sizeof(rssi)); + /* Note that info already contains one byte which accounts for RSSI */ + + info = bt_buf_consume(buf, sizeof(*info) + info->length); } } @@ -1909,8 +1913,8 @@ send_set_param: set_param = bt_buf_extend(buf, sizeof(*set_param)); memset(set_param, 0, sizeof(*set_param)); - set_param->min_interval = BT_HOST2LE16(0x0800); - set_param->max_interval = BT_HOST2LE16(0x0800); + set_param->min_interval = BT_HOST2LE16(300); + set_param->max_interval = BT_HOST2LE16(300); set_param->type = type; set_param->channel_map = 0x07;
