-
Notifications
You must be signed in to change notification settings - Fork 2
/
LEDBlinker.h
48 lines (36 loc) · 1.22 KB
/
LEDBlinker.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
#ifndef LED_BLINKER_H
#define LED_BLINKER_H
#include <string>
#include <FCam/FCam.h>
#include <FCam/Action.h>
#include <FCam/Device.h>
/* An FCam Device to flash one of the LEDs on the front of the device at capture time. */
class LEDBlinker : public FCam::Device {
public:
LEDBlinker();
~LEDBlinker();
/*
* An action representing the blinking of the front LED
*/
class BlinkAction : public FCam::CopyableAction<BlinkAction> {
public:
/* Constructors and destructor */
BlinkAction(LEDBlinker * b);
BlinkAction(LEDBlinker * b, int time);
/* Implementation of doAction() as required */
void doAction() {blinker->blink();}
protected:
LEDBlinker *blinker;
int size;
};
/* Normally, this is where a device would add metadata tags to a
* just-created frame , based on the timestamps in the
* Frame. However, we don't have anything useful to add here, so
* tagFrame does nothing. */
void tagFrame(FCam::Frame) {}
/* Flashes the LED */
void blink();
/* Returns latency in microseconds. Zero is a reasonable approximate for this device. */
int getLatency() {return 0;}
};
#endif