-
Notifications
You must be signed in to change notification settings - Fork 0
/
bt_collector_cacher.h
36 lines (19 loc) · 998 Bytes
/
bt_collector_cacher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2020 DriveX.Tech. All rights reserved.
//
// Licensed under the License.
#ifndef _BT_COLLECTOR_CACHER_H_
#define _BT_COLLECTOR_CACHER_H_
#include "types.h"
#include "protothread/pt.h"
#include "bt_collector.h"
//#define SEND_BT_DATA(P_BT_ADDR, DATA, DATA_LEN)
#define SEND_BT_DATA(P_BT_ADDR, DATA, DATA_LEN) send_bt_rawbytes(P_BT_ADDR, DATA, DATA_LEN)
#define POP_BT_DATA(P_BT_ADDR, DATA, DATA_LEN) pop_queued_bt_data(, DATA, DATA_LEN)
#define PEEK_BT_DATA(P_BT_ADDR, DATA, DATA_LEN) peek_queued_bt_data(, DATA, DATA_LEN)
int get_cached_bt_packet_num(); // Note: NOT thread safe
PT_THREAD(process_cached_bt_packet(struct pt* pt, int* num_packet_processed));
bool bt_collector_cacher_init();
extern void on_ble_data_received(const bt_addr_t* peer_addr, const BYTE* data, WORD data_len);
extern void on_ble_data_sent(const bt_addr_t* peer_addr);
bool send_bt_rawbytes(const bt_addr_t* bt_addr, const BYTE* data, WORD data_len);
#endif