diff options
| author | Jan Sucan <sucanjan@fit.cvut.cz> | 2019-06-04 14:34:27 +0200 |
|---|---|---|
| committer | Jan Sucan <sucanjan@fit.cvut.cz> | 2019-06-04 14:34:27 +0200 |
| commit | dc8703206e3f0f69605c56d0e1127f7e17f3476a (patch) | |
| tree | 166823a741dc420c10d54250cb53d1e3a6b74faf /testing/yup-comm/comm/bt.h | |
Initial commit
Diffstat (limited to 'testing/yup-comm/comm/bt.h')
| -rw-r--r-- | testing/yup-comm/comm/bt.h | 30 |
1 files changed, 30 insertions, 0 deletions
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 <windows.h> +#include <stdint.h> +#include <stdlib.h> +#include <stdbool.h> +#include <limits.h> + +#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_ */ |
