blink1-lib  1.0.0
Blink1TestingLibrary.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <exception>
9 #include <string>
10 #include <vector>
11 #include <map>
12 
13 #include "RGB.hpp"
14 #include "PlayState.hpp"
15 #include "PatternLineN.hpp"
16 
17 #include "blink1-lib.h"
18 
20 typedef struct hid_device_ {} hid_device_;
22 
35 namespace fake_blink1_lib {
37  extern std::vector<blink1_device*> blink1_devices;
38  extern std::map<long, blink1_lib::RGB> ledColors;
39  extern std::map<long, uint16_t> ledFadeMillis;
40  extern std::map<long, blink1_lib::PatternLineN> patternLines;
41  extern int cacheIndex;
42  extern std::string serial;
43  extern bool isMk2;
44  extern uint8_t patternLineLEDN;
45  extern blink1_lib::PlayState playState;
46  extern int blink1Version;
47  extern bool successfulOperation;
48  extern bool successfulInit;
49  extern bool degammaEnabled;
50  extern int vid;
51  extern int pid;
53 
59  void CLEAR_ALL();
60 
69  bool ALL_DEVICES_FREED();
70 
74  void SET_BLINK1_VERSION(int version);
75 
81  void SET_BLINK1_SUCCESSFUL_OPERATION(bool op);
82 
87  void SET_BLINK1_SUCCESSFUL_INIT(bool init);
88 
93  void SET_BLINK1_VID(int _vid);
94 
99  void SET_BLINK1_PID(int _pid);
100 
105  void SET_CACHE_INDEX(int index);
106 
111  void SET_SERIAL(std::string serial);
112 
117  void SET_IS_MK2(bool mk2);
118 
122  bool SUCCESS(blink1_device* dev);
123 
127  blink1_lib::RGB GET_RGB(long n);
128 
132  void SET_RGB(blink1_lib::RGB rgb, long n);
133 
139  uint16_t GET_FADE_MILLIS(long n);
140 
144  void SET_FADE_MILLIS(uint16_t fadeMillis, long n);
145 
150 
154  void SET_PATTERN_LINE(blink1_lib::PatternLineN line, long pos);
155 
160 
165 }
fake_blink1_lib::SET_IS_MK2
void SET_IS_MK2(bool mk2)
fake_blink1_lib::SET_FADE_MILLIS
void SET_FADE_MILLIS(uint16_t fadeMillis, long n)
fake_blink1_lib::SET_PLAY_STATE
void SET_PLAY_STATE(blink1_lib::PlayState state)
fake_blink1_lib::GET_RGB
blink1_lib::RGB GET_RGB(long n)
PlayState.hpp
Header for blink1_lib::PlayState.
fake_blink1_lib::SET_BLINK1_VID
void SET_BLINK1_VID(int _vid)
blink1_lib::PatternLineN
Definition: PatternLineN.hpp:17
fake_blink1_lib::SET_BLINK1_PID
void SET_BLINK1_PID(int _pid)
fake_blink1_lib::GET_PLAY_STATE
blink1_lib::PlayState GET_PLAY_STATE()
fake_blink1_lib::SET_SERIAL
void SET_SERIAL(std::string serial)
fake_blink1_lib::SUCCESS
bool SUCCESS(blink1_device *dev)
fake_blink1_lib::GET_FADE_MILLIS
uint16_t GET_FADE_MILLIS(long n)
fake_blink1_lib::SET_BLINK1_VERSION
void SET_BLINK1_VERSION(int version)
fake_blink1_lib::SET_BLINK1_SUCCESSFUL_OPERATION
void SET_BLINK1_SUCCESSFUL_OPERATION(bool op)
PatternLineN.hpp
Header file for blink1_lib::PatternLineN.
fake_blink1_lib::SET_RGB
void SET_RGB(blink1_lib::RGB rgb, long n)
fake_blink1_lib
Testing library namespace.
Definition: Blink1TestingLibrary.hpp:35
blink1_lib::RGB
Definition: RGB.hpp:16
fake_blink1_lib::SET_BLINK1_SUCCESSFUL_INIT
void SET_BLINK1_SUCCESSFUL_INIT(bool init)
fake_blink1_lib::ALL_DEVICES_FREED
bool ALL_DEVICES_FREED()
blink1_lib::PlayState
Definition: PlayState.hpp:16
RGB.hpp
Header file for blink1_lib::RGB.
fake_blink1_lib::GET_PATTERN_LINE
blink1_lib::PatternLineN GET_PATTERN_LINE(long pos)
fake_blink1_lib::CLEAR_ALL
void CLEAR_ALL()
fake_blink1_lib::SET_CACHE_INDEX
void SET_CACHE_INDEX(int index)
fake_blink1_lib::SET_PATTERN_LINE
void SET_PATTERN_LINE(blink1_lib::PatternLineN line, long pos)