-
Notifications
You must be signed in to change notification settings - Fork 1
/
handler.h
27 lines (21 loc) · 771 Bytes
/
handler.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
#ifndef Handler_h
#define Handler_h
#include <Arduino.h>
#include <vector>
#include "pulse.h"
namespace rx433 {
// Handler should be implemented by a class that supports a specific
// modulation scheme.
class Handler {
public:
// IsSync takes a single Pulse and returns true if this is possibly
// a valid sync pulse for this handler. Try to make this as specific
// as possible as it improves performance of the interrupt handler.
virtual bool IsSync(const Pulse& p) = 0;
// Handle takes a vector of pulses and demodulates them, returning
// true if successful. If this returns false, the library will give
// the pulse vector to the next handler.
virtual bool Handle(const std::vector<Pulse>& buf) = 0;
};
} // namespace rx433
#endif // Handler_h