CCIMXDesktop
 
Loading...
Searching...
No Matches
led_adapter.h
1/*
2 This is a led adapter, which is using in
3 drive the led in upper level way
4*/
5
6#ifndef LED_ADAPTER
7#define LED_ADAPTER
8
9#ifdef USE_REAL_ADAPTER
10
11#include "LEDParamsPackage.h"
12#include <string>
13
16class LEDAdapter {
17public:
19 explicit LEDAdapter() = default;
20
22 ~LEDAdapter() = default;
23
26 void redirectTo(const std::string& ledName);
27
30 std::string ledPath() const { return led_path; }
31
34 inline void setMode(const Modes mode) { this->mode = mode; }
35
38 inline Modes getMode() const { return this->mode; }
39
43 bool processByPackage(const LEDParamsPackage* package);
44
45private:
46 std::string led_path;
47 Modes mode { Modes::Plain };
48
53 bool write_file(const std::string& fileName, const std::string& content);
54};
55
56#endif // USE_REAL_ADAPTER
57
58#endif // LED_ADAPTER
Base class for LED parameter packages.
Definition LEDParamsPackage.h:14