diff options
author | Levi Oliver <levio@google.com> | 2016-08-12 09:08:23 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-08-12 20:49:45 -0700 |
commit | 31f297da0b9cb3b4e6fb1cc2f044f71df1c830c2 (patch) | |
tree | e2ee09fd2bd8c1d30cb5d1b930748ea43d46b9c8 /include/bluetooth_le.h | |
parent | f1951ce3a76781f2c3a311342651dc827828d722 (diff) | |
download | chrome-ec-31f297da0b9cb3b4e6fb1cc2f044f71df1c830c2.tar.gz |
btle: Timeout of ble_rx now based on chip time
Previously, timeout meant the number of attempts taken to receive. Now,
it means the number of microseconds before timing out.
TEST=printouts displaying time before and after rx attempt. Not included
in CL.
BUG=None
BRANCH=None
Change-Id: I00ccfc4bbf15f77c2777f35c911dceacaff98e4f
Signed-off-by: Levi Oliver <levio@google.com>
Reviewed-on: https://chromium-review.googlesource.com/368471
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/bluetooth_le.h')
-rw-r--r-- | include/bluetooth_le.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/bluetooth_le.h b/include/bluetooth_le.h index 07a0dde5df..8e0422c3a7 100644 --- a/include/bluetooth_le.h +++ b/include/bluetooth_le.h @@ -352,6 +352,14 @@ void fill_remapping_table(struct remapping_table *rt, uint8_t map[5], void ble_tx(struct ble_pdu *pdu); +/** + * Receive a packet into pdu if one comes before the timeout + * + * @param pdu Where the received data is to be stored + * @param timeout Number of microseconds allowed before timeout + * @param adv Set to 1 if receiving in advertising state; else set to 0 + * @returns EC_SUCCESS on packet reception, else returns error + */ int ble_rx(struct ble_pdu *pdu, int timeout, int adv); int ble_radio_init(uint32_t access_address, uint32_t crc_init_val); |