Bluetooth: controller: Fix HCI remote version structure
The HCI Read Remote Version Information Complete event structure was incorrect, leading to qualification test failures. This patch fixes the structure and also the storing of the data in an endianness-agnostic manner. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
269a828cb1
commit
d990079f15
2 changed files with 6 additions and 7 deletions
|
@ -1328,7 +1328,7 @@ struct bt_hci_evt_remote_version_info {
|
||||||
u16_t handle;
|
u16_t handle;
|
||||||
u8_t version;
|
u8_t version;
|
||||||
u16_t manufacturer;
|
u16_t manufacturer;
|
||||||
u8_t subversion;
|
u16_t subversion;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
#define BT_HCI_EVT_CMD_COMPLETE 0x0e
|
#define BT_HCI_EVT_CMD_COMPLETE 0x0e
|
||||||
|
|
|
@ -2033,6 +2033,7 @@ static void le_unknown_rsp(struct pdu_data *pdu_data, u16_t handle,
|
||||||
static void remote_version_info(struct pdu_data *pdu_data, u16_t handle,
|
static void remote_version_info(struct pdu_data *pdu_data, u16_t handle,
|
||||||
struct net_buf *buf)
|
struct net_buf *buf)
|
||||||
{
|
{
|
||||||
|
struct pdu_data_llctrl_version_ind *ver_ind;
|
||||||
struct bt_hci_evt_remote_version_info *ep;
|
struct bt_hci_evt_remote_version_info *ep;
|
||||||
|
|
||||||
if (!(event_mask & BT_EVT_MASK_REMOTE_VERSION_INFO)) {
|
if (!(event_mask & BT_EVT_MASK_REMOTE_VERSION_INFO)) {
|
||||||
|
@ -2042,14 +2043,12 @@ static void remote_version_info(struct pdu_data *pdu_data, u16_t handle,
|
||||||
evt_create(buf, BT_HCI_EVT_REMOTE_VERSION_INFO, sizeof(*ep));
|
evt_create(buf, BT_HCI_EVT_REMOTE_VERSION_INFO, sizeof(*ep));
|
||||||
ep = net_buf_add(buf, sizeof(*ep));
|
ep = net_buf_add(buf, sizeof(*ep));
|
||||||
|
|
||||||
|
ver_ind = &pdu_data->payload.llctrl.ctrldata.version_ind;
|
||||||
ep->status = 0x00;
|
ep->status = 0x00;
|
||||||
ep->handle = sys_cpu_to_le16(handle);
|
ep->handle = sys_cpu_to_le16(handle);
|
||||||
ep->version =
|
ep->version = ver_ind->version_number;
|
||||||
pdu_data->payload.llctrl.ctrldata.version_ind.version_number;
|
ep->manufacturer = sys_cpu_to_le16(ver_ind->company_id);
|
||||||
ep->manufacturer =
|
ep->subversion = sys_cpu_to_le16(ver_ind->sub_version_number);
|
||||||
pdu_data->payload.llctrl.ctrldata.version_ind.company_id;
|
|
||||||
ep->subversion =
|
|
||||||
pdu_data->payload.llctrl.ctrldata.version_ind.sub_version_number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_conn_param_req(struct pdu_data *pdu_data, u16_t handle,
|
static void le_conn_param_req(struct pdu_data *pdu_data, u16_t handle,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue