-
Notifications
You must be signed in to change notification settings - Fork 0
/
DecodeOOK.h
43 lines (38 loc) · 1.07 KB
/
DecodeOOK.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
40
41
42
43
// Oregon V2 decoder added - Dominique Pierre
// Oregon V3 decoder revisited - Dominique Pierre
// New code to decode OOK signals from weather sensors, etc.
// 2010-04-11 <[email protected]> http://opensource.org/licenses/mit-license.php
// $Id: ookDecoder.pde 5331 2010-04-17 10:45:17Z jcw $
#ifndef _DecodeOOK_h
#ifdef __cplusplus
#define _DecodeOOK_h
#include <Arduino.h>
#include "Sensor.h"
#include "WeatherData.h"
class DecodeOOK {
protected:
byte total_bits, bits, flip, state, pos, data[25];
virtual char decode (word width);
Sensor * sensors[10];
int sensorCount;
public:
enum { UNKNOWN, T0, T1, T2, T3, OK, DONE };
DecodeOOK ();
bool nextPulse (word width);
bool isDone () const;
const byte* getData (byte& count) const;
void resetDecoder ();
virtual void gotBit (char value);
void manchester (char value);
void alignTail (byte max);
void reverseBits ();
void reverseNibbles ();
void done ();
void dataReceived();
void addSensor(Sensor*);
bool canDecode();
void getWeatherData(WeatherData*);
int getSensorCount();
};
#endif
#endif