diff options
author | Zach Johnson <zachoverflow@google.com> | 2014-08-21 21:00:43 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2015-03-16 16:51:29 -0700 |
commit | bb170c1ed53a8c8ed70817cd6ce633cf94c05289 (patch) | |
tree | 81d75cd2cdb0fb9417d19ed5e431923557e4bdd1 /hci/src/hci_hal_mct.c | |
parent | 8301641159ea44be2694b4418af4a176aa5d1328 (diff) | |
download | android_system_bt-bb170c1ed53a8c8ed70817cd6ce633cf94c05289.tar.gz android_system_bt-bb170c1ed53a8c8ed70817cd6ce633cf94c05289.tar.bz2 android_system_bt-bb170c1ed53a8c8ed70817cd6ce633cf94c05289.zip |
Modify eager reader to support multi-byte reads
Diffstat (limited to 'hci/src/hci_hal_mct.c')
-rw-r--r-- | hci/src/hci_hal_mct.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/hci/src/hci_hal_mct.c b/hci/src/hci_hal_mct.c index e1d855759..4e0835110 100644 --- a/hci/src/hci_hal_mct.c +++ b/hci/src/hci_hal_mct.c @@ -122,28 +122,17 @@ static void hal_close() { uart_fds[i] = INVALID_FD; } -static uint8_t read_byte(serial_data_type_t type) { +static size_t read_data(serial_data_type_t type, uint8_t *buffer, size_t max_size, bool block) { if (type == DATA_TYPE_ACL) { - return eager_reader_read_byte(acl_stream); + return eager_reader_read(acl_stream, buffer, max_size, block); } else if (type == DATA_TYPE_EVENT) { - return eager_reader_read_byte(event_stream); + return eager_reader_read(event_stream, buffer, max_size, block); } ALOGE("%s invalid data type: %d", __func__, type); return 0; } -static bool has_byte(serial_data_type_t type) { - if (type == DATA_TYPE_ACL) { - return eager_reader_has_byte(acl_stream); - } else if (type == DATA_TYPE_EVENT) { - return eager_reader_has_byte(event_stream); - } - - ALOGE("%s invalid data type: %d", __func__, type); - return false; -} - static void packet_finished(UNUSED_ATTR serial_data_type_t type) { // not needed by this protocol } @@ -201,8 +190,7 @@ static const hci_hal_interface_t interface = { hal_open, hal_close, - read_byte, - has_byte, + read_data, packet_finished, transmit_data, }; |