-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathremote.h
More file actions
34 lines (25 loc) · 740 Bytes
/
remote.h
File metadata and controls
34 lines (25 loc) · 740 Bytes
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
#ifndef REMOTE_H
#define REMOTE_H
#include "constants.h"
#include "radio.h"
class Radio;
class Remote
{
public:
Remote(Radio *radio, uint32_t serial, const char *name);
~Remote();
uint32_t getSerial();
String getSerialString();
const char *getName();
bool registerCommandListener(std::function<void(Remote *, byte, byte)> callback);
bool unregisterCommandListener(std::function<void(Remote *, byte, byte)> callback);
void callback(byte command, byte options);
private:
Radio *radio;
uint32_t serial;
const char *name;
String serialString;
std::function<void(Remote *, byte, byte)> commandListeners[constants::MAX_COMMAND_LISTENERS];
uint8_t numCommandListeners = 0;
};
#endif