Loading system/hci/include/userial.h +1 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ bool userial_init(void); // returns false if there was an error. bool userial_open(userial_port_t port); void userial_close(void); void userial_close_reader(void); // Reads a maximum of |len| bytes from the serial port into |p_buffer|. // This function returns the number of bytes actually read, which may be Loading system/hci/src/bt_hci_bdroid.c +4 −1 Original line number Diff line number Diff line Loading @@ -465,9 +465,11 @@ static void cleanup(void) if (fwcfg_acked) { epilog_wait_timer(); // Stop reading thread userial_close_reader(); thread_post(hc_cb.worker_thread, event_epilog, NULL); } thread_free(hc_cb.worker_thread); pthread_mutex_lock(&hc_cb.worker_thread_lock); Loading @@ -480,6 +482,7 @@ static void cleanup(void) hc_cb.epilog_timer_created = false; } } BTHCDBG("%s Finalizing cleanup\n", __func__); lpm_cleanup(); userial_close(); Loading system/hci/src/userial.c +13 −0 Original line number Diff line number Diff line Loading @@ -374,6 +374,19 @@ uint16_t userial_write(uint16_t msg_id, const uint8_t *p_data, uint16_t len) { return total; } void userial_close_reader(void) { // Join the reader thread if it is still running. if (userial_running) { send_event(USERIAL_RX_EXIT); int result = pthread_join(userial_cb.read_thread, NULL); USERIALDBG("%s Joined userial reader thread: %d", __func__, result); if (result) ALOGE("%s failed to join reader thread: %d", __func__, result); return; } ALOGW("%s Already closed userial reader thread", __func__); } void userial_close(void) { assert(bt_hc_cbacks != NULL); Loading Loading
system/hci/include/userial.h +1 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ bool userial_init(void); // returns false if there was an error. bool userial_open(userial_port_t port); void userial_close(void); void userial_close_reader(void); // Reads a maximum of |len| bytes from the serial port into |p_buffer|. // This function returns the number of bytes actually read, which may be Loading
system/hci/src/bt_hci_bdroid.c +4 −1 Original line number Diff line number Diff line Loading @@ -465,9 +465,11 @@ static void cleanup(void) if (fwcfg_acked) { epilog_wait_timer(); // Stop reading thread userial_close_reader(); thread_post(hc_cb.worker_thread, event_epilog, NULL); } thread_free(hc_cb.worker_thread); pthread_mutex_lock(&hc_cb.worker_thread_lock); Loading @@ -480,6 +482,7 @@ static void cleanup(void) hc_cb.epilog_timer_created = false; } } BTHCDBG("%s Finalizing cleanup\n", __func__); lpm_cleanup(); userial_close(); Loading
system/hci/src/userial.c +13 −0 Original line number Diff line number Diff line Loading @@ -374,6 +374,19 @@ uint16_t userial_write(uint16_t msg_id, const uint8_t *p_data, uint16_t len) { return total; } void userial_close_reader(void) { // Join the reader thread if it is still running. if (userial_running) { send_event(USERIAL_RX_EXIT); int result = pthread_join(userial_cb.read_thread, NULL); USERIALDBG("%s Joined userial reader thread: %d", __func__, result); if (result) ALOGE("%s failed to join reader thread: %d", __func__, result); return; } ALOGW("%s Already closed userial reader thread", __func__); } void userial_close(void) { assert(bt_hc_cbacks != NULL); Loading