From dc8703206e3f0f69605c56d0e1127f7e17f3476a Mon Sep 17 00:00:00 2001 From: Jan Sucan Date: Tue, 4 Jun 2019 14:34:27 +0200 Subject: Initial commit --- testing/yup-comm/comm/bt.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 testing/yup-comm/comm/bt.h (limited to 'testing/yup-comm/comm/bt.h') diff --git a/testing/yup-comm/comm/bt.h b/testing/yup-comm/comm/bt.h new file mode 100644 index 0000000..a9df2d5 --- /dev/null +++ b/testing/yup-comm/comm/bt.h @@ -0,0 +1,30 @@ +/* Author: Jan Sucan */ + +#ifndef BT_H_ +#define BT_H_ + +#include +#include +#include +#include +#include + +#define BT_RECEIVE_COBS_START false + +#define BT_RECEIVE_COBS_CONTINUE true + +typedef enum { + BT_RECEIVE_BAD_ARGUMENT = INT_MIN, + BT_RECEIVE_TIMEOUT, + BT_RECEIVE_ERROR, + BT_RECEIVE_COBS_INTERRUPTED, + BT_RECEIVE_COBS_UNKNOWN_STATE, + BT_OK = 0 +} bt_retcode_t; + +void bt_init(HANDLE serial_port); +void bt_close(void); +bt_retcode_t bt_receive_cobs_data(uint8_t * const buf, size_t n, bool cobs_continue); +void bt_send_cobs_data_block(const uint8_t *const buf, size_t n); + +#endif /* BT_H_ */ -- cgit v1.2.3