-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLogger.h
38 lines (33 loc) · 822 Bytes
/
Logger.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
#ifndef _LOGGER_h
#define _LOGGER_h
#include "Arduino.h"
#include "TypedQueue.h"
class Logger {
private:
TypedQueue<String> m_queue;
bool m_enabled;
String m_currentLine;
byte m_bufferSize;
public:
enum LogType {
SYS = 0,
DATA = 1,
PCA301 = 2,
ONLYSYS = 3
};
Logger(byte bufferSize=20);
void print(String data, LogType type = LogType::SYS);
void print(uint32_t data, LogType type = LogType::SYS);
void println(String data, LogType type = LogType::SYS);
void println(LogType type = LogType::SYS);
void println(uint32_t data, LogType type = LogType::SYS);
void logData(String data, LogType type = LogType::SYS);
int Available();
String Pop();
void Disable();
void Enable();
bool IsEnabled();
void Clear();
void SetBufferSize(byte size);
};
#endif