forked from AprilBrother/BLEPad_UART
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BLEPad_UART.h
39 lines (26 loc) · 874 Bytes
/
BLEPad_UART.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
37
38
39
#ifndef _BLEPAD_UART_H
#define _BLEPAD_UART_H
#include <Arduino.h>
#define BLEPAD_MASTER_MODE 0
#define BLEPAD_SLAVE_MODE 1
class BLEPad_UART : public Print {
public:
BLEPad_UART(HardwareSerial &s);
void println(const char data[]);
void begin(unsigned long baud);
void end(void);
int available();
int read();
virtual size_t write(uint8_t c);
virtual size_t println(int, int = DEC);
virtual void flush(void);
virtual int peek(void);
// pull in write(str) and write(buf, size) from Print
using Print::write;
void setConfigMode(bool mode);
// Work only for firmware version >= 5.0
void setRole(int role);
private:
HardwareSerial *hs; // -> BLE module, e.g. Serial1
};
#endif