-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathStation.h
48 lines (39 loc) · 934 Bytes
/
Station.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
44
45
46
47
48
/*
* Station.h
*
* Created on: Jan 30, 2013
* Author: Matheus (X-warrior) Bratfisch ([email protected])
*/
#ifndef STATION_H_
#define STATION_H_
#include "GenericStation.h"
#include "config.h"
template <class MESSAGE_TYPE>
class Station: public GenericStation<MESSAGE_TYPE> {
private:
void startup();
protected:
enum FLAGS {
NOTHING, RETRANSMIT_FIRST, RETRANSMIT, WAITING
};
uint8_t flag;
uint8_t forward;
uint8_t idSelection[5];
uint8_t levelSelection[5];
uint8_t control;
void sendWhoListen();
bool sendAskConfig(bool resend);
void receivedWhoListen(MESSAGE_TYPE p);
void receivedIListen(MESSAGE_TYPE p);
void receivedAskConfig(MESSAGE_TYPE p);
void receivedSetConfig(MESSAGE_TYPE p);
public:
Station();
Station(uint8_t ce, uint8_t csn);
void begin();
bool write(MESSAGE_TYPE msg);
int update(MESSAGE_TYPE p[5]);
virtual ~Station();
};
#include "Station-impl.h"
#endif /* STATION_H_ */