Skip to content

Commit 971c2c9

Browse files
PavelVPVfabiobaltieri
authored andcommitted
Revert "Bluetooth: host: extract sending of host num complete"
This reverts commit 32212bf. Signed-off-by: Pavel Vasilyev <[email protected]>
1 parent da9acbc commit 971c2c9

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

subsys/bluetooth/host/hci_core.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ __weak void bt_testing_trace_event_acl_pool_destroy(struct net_buf *buf)
292292
#if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL)
293293
void bt_hci_host_num_completed_packets(struct net_buf *buf)
294294
{
295+
struct bt_hci_cp_host_num_completed_packets *cp;
295296
uint16_t handle = acl(buf)->handle;
297+
struct bt_hci_handle_count *hc;
296298
struct bt_conn *conn;
297299
uint8_t index = acl(buf)->index;
298300

@@ -322,7 +324,23 @@ void bt_hci_host_num_completed_packets(struct net_buf *buf)
322324

323325
bt_conn_unref(conn);
324326

325-
bt_send_one_host_num_completed_packets(handle);
327+
LOG_DBG("Reporting completed packet for handle %u", handle);
328+
329+
buf = bt_hci_cmd_create(BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS,
330+
sizeof(*cp) + sizeof(*hc));
331+
if (!buf) {
332+
LOG_ERR("Unable to allocate new HCI command");
333+
return;
334+
}
335+
336+
cp = net_buf_add(buf, sizeof(*cp));
337+
cp->num_handles = sys_cpu_to_le16(1);
338+
339+
hc = net_buf_add(buf, sizeof(*hc));
340+
hc->handle = sys_cpu_to_le16(handle);
341+
hc->count = sys_cpu_to_le16(1);
342+
343+
bt_hci_cmd_send(BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS, buf);
326344
}
327345
#endif /* defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) */
328346

0 commit comments

Comments
 (0)