From b36cf1a947bc48050bcd3952d9f67f8f3f0b5752 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Fri, 20 Dec 2013 19:22:19 +0000 Subject: [PATCH] send DAEMON_EVENT_HCI_PACKET_SENT as valid HCI Event - fixes issue #360 --- src/hci_transport_h4_dma.c | 4 ++-- src/hci_transport_h4_ehcill_dma.c | 4 ++-- src/hci_transport_usb.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hci_transport_h4_dma.c b/src/hci_transport_h4_dma.c index a0dc02c66..36750156e 100644 --- a/src/hci_transport_h4_dma.c +++ b/src/hci_transport_h4_dma.c @@ -254,8 +254,8 @@ static int h4_process(struct data_source *ds) { if (tx_state == TX_DONE){ // reset state tx_state = TX_IDLE; - uint8_t event = DAEMON_EVENT_HCI_PACKET_SENT; - packet_handler(HCI_EVENT_PACKET, &event, 1); + uint8_t event[] = { DAEMON_EVENT_HCI_PACKET_SENT, 0 }; + packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event)); } if (h4_state != H4_PACKET_RECEIVED) return 0; diff --git a/src/hci_transport_h4_ehcill_dma.c b/src/hci_transport_h4_ehcill_dma.c index f208f40c3..a2b9f8471 100644 --- a/src/hci_transport_h4_ehcill_dma.c +++ b/src/hci_transport_h4_ehcill_dma.c @@ -341,8 +341,8 @@ static int h4_process(struct data_source *ds) { if (tx_state == TX_DONE){ // reset state tx_state = TX_IDLE; - uint8_t event = DAEMON_EVENT_HCI_PACKET_SENT; - packet_handler(HCI_EVENT_PACKET, &event, 1); + uint8_t event[] = { DAEMON_EVENT_HCI_PACKET_SENT, 0 }; + packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event)); } if (h4_state != H4_PACKET_RECEIVED) return 0; diff --git a/src/hci_transport_usb.c b/src/hci_transport_usb.c index c63804812..0d3b505d5 100644 --- a/src/hci_transport_usb.c +++ b/src/hci_transport_usb.c @@ -286,7 +286,7 @@ static void handle_completed_transfer(struct libusb_transfer *transfer){ // notify upper stack that iit might be possible to send again uint8_t event[] = { DAEMON_EVENT_HCI_PACKET_SENT, 0}; - packet_handler(HCI_EVENT_PACKET, (uint8_t*) &event, 2); + packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event)); resubmit = 0; } else if (transfer->endpoint == 0){ @@ -295,7 +295,7 @@ static void handle_completed_transfer(struct libusb_transfer *transfer){ // notify upper stack that iit might be possible to send again uint8_t event[] = { DAEMON_EVENT_HCI_PACKET_SENT, 0}; - packet_handler(HCI_EVENT_PACKET, (uint8_t*) &event, 2); + packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event)); resubmit = 0; } else {