From ace087123b7d8b6913e24abeff12ea0a80b893ce Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 7 Mar 2022 20:12:32 +0100 Subject: [PATCH] hci: add hci_send_iso_packet_buffer --- src/hci.c | 14 ++++++++++++++ src/hci.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/hci.c b/src/hci.c index fb89f4138..adbd93130 100644 --- a/src/hci.c +++ b/src/hci.c @@ -973,6 +973,20 @@ uint8_t hci_send_sco_packet_buffer(int size){ } #endif +#ifdef ENABLE_BLE +uint8_t hci_send_iso_packet_buffer(uint16_t size){ + btstack_assert(hci_stack->hci_packet_buffer_reserved); + + uint8_t * packet = hci_stack->hci_packet_buffer; + // TODO: check for space on controller + // TODO: track outgoing packet sent + hci_dump_packet( HCI_ISO_DATA_PACKET, 0, packet, size); + + int err = hci_stack->hci_transport->send_packet(HCI_ISO_DATA_PACKET, packet, size); + return (err == 0) ? ERROR_CODE_SUCCESS : ERROR_CODE_HARDWARE_FAILURE; +} +#endif + static void acl_handler(uint8_t *packet, uint16_t size){ // get info diff --git a/src/hci.h b/src/hci.h index 90b6324be..caac54c82 100644 --- a/src/hci.h +++ b/src/hci.h @@ -1308,6 +1308,11 @@ bool hci_can_send_prepared_sco_packet_now(void); */ uint8_t hci_send_sco_packet_buffer(int size); +/** + * @brief Send ISO packet prepared in HCI packet buffer + */ +uint8_t hci_send_iso_packet_buffer(uint16_t size); + /** * Reserves outgoing packet buffer. * @return true on success