diff options
Diffstat (limited to 'hci/src')
-rw-r--r-- | hci/src/bt_hci_bdroid.c | 4 | ||||
-rw-r--r-- | hci/src/bt_hw.c | 24 | ||||
-rw-r--r-- | hci/src/userial.c | 43 |
3 files changed, 13 insertions, 58 deletions
diff --git a/hci/src/bt_hci_bdroid.c b/hci/src/bt_hci_bdroid.c index 2450ed5..85199ec 100644 --- a/hci/src/bt_hci_bdroid.c +++ b/hci/src/bt_hci_bdroid.c @@ -368,7 +368,7 @@ static void *bt_hc_worker_thread(void *arg) uint16_t events; HC_BT_HDR *p_msg, *p_next_msg; - BTHCDBG("bt_hc_worker_thread started"); + ALOGI("bt_hc_worker_thread started"); tx_cmd_pkts_pending = FALSE; while (lib_running) @@ -497,7 +497,7 @@ static void *bt_hc_worker_thread(void *arg) break; } - BTHCDBG("bt_hc_worker_thread exiting"); + ALOGI("bt_hc_worker_thread exiting"); pthread_exit(NULL); diff --git a/hci/src/bt_hw.c b/hci/src/bt_hw.c index 414ee60..1705213 100644 --- a/hci/src/bt_hw.c +++ b/hci/src/bt_hw.c @@ -192,27 +192,6 @@ static uint8_t xmit_cb(uint16_t opcode, void *p_buf, tINT_CMD_CBACK p_cback) return hci_h4_send_int_cmd(opcode, (HC_BT_HDR *)p_buf, p_cback); } -/****************************************************************************** -** -** Function usrl_ctrl_cb -** -** Description HOST/CONTROLLER VEDNOR LIB CALLOUT API - This function is -** called from the libbt-vendor in order to configure userial -** attributes. -** -** Returns None -** -******************************************************************************/ -static void usrl_ctrl_cb(bt_vendor_userial_cid_t cid, void *param) -{ - if (cid == BT_VND_USERIAL_SET_BAUD) - { - uint8_t *baud = (uint8_t *) param; - - userial_change_baud(*baud); - } -} - /***************************************************************************** ** The libbt-vendor Callback Functions Table *****************************************************************************/ @@ -223,8 +202,7 @@ static const bt_vendor_callbacks_t vnd_callbacks = { lpm_vnd_cb, alloc, dealloc, - xmit_cb, - usrl_ctrl_cb + xmit_cb }; /****************************************************************************** diff --git a/hci/src/userial.c b/hci/src/userial.c index 988f2f8..92540c9 100644 --- a/hci/src/userial.c +++ b/hci/src/userial.c @@ -116,27 +116,6 @@ typedef struct static tUSERIAL_CB userial_cb; static volatile uint8_t userial_running = 0; -/* for friendly debugging outpout string */ -static uint32_t userial_baud_tbl[] = -{ - 300, /* USERIAL_BAUD_300 0 */ - 600, /* USERIAL_BAUD_600 1 */ - 1200, /* USERIAL_BAUD_1200 2 */ - 2400, /* USERIAL_BAUD_2400 3 */ - 9600, /* USERIAL_BAUD_9600 4 */ - 19200, /* USERIAL_BAUD_19200 5 */ - 57600, /* USERIAL_BAUD_57600 6 */ - 115200, /* USERIAL_BAUD_115200 7 */ - 230400, /* USERIAL_BAUD_230400 8 */ - 460800, /* USERIAL_BAUD_460800 9 */ - 921600, /* USERIAL_BAUD_921600 10 */ - 1000000, /* USERIAL_BAUD_1M 11 */ - 1500000, /* USERIAL_BAUD_1_5M 12 */ - 2000000, /* USERIAL_BAUD_2M 13 */ - 3000000, /* USERIAL_BAUD_3M 14 */ - 4000000 /* USERIAL_BAUD_4M 15 */ -}; - /****************************************************************************** ** Static functions ******************************************************************************/ @@ -551,18 +530,16 @@ void userial_close(void) *******************************************************************************/ void userial_change_baud(uint8_t baud) { - USERIALDBG("userial_change_baud: Closing UART Port"); - userial_close(); - - utils_delay(100); - - /* change baud rate in settings - leave everything else the same */ - userial_cb.cfg.baud = baud; - - ALOGI("userial_change_rate: Attempting to reopen the UART Port at %i", \ - (unsigned int)userial_baud_tbl[baud]); - - userial_open(userial_cb.port, &userial_cb.cfg); + /* Calling vendor-specific part */ + if (bt_vnd_if) + { + bt_vnd_if->op(BT_VND_OP_USERIAL_SET_BAUD, &baud); + } + else + { + ALOGE("userial_change_baud: missing vendor lib interface !!!"); + ALOGE("userial_change_baud: unable to change UART baud rate"); + } } /******************************************************************************* |