Corsair Lighting Protocol  0.15.0
Control LEDs connected to an Arduino with iCUE
CorsairLightingProtocolHID.h
1 /*
2  Copyright 2019 Leon Kiefer
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 #pragma once
17 
18 #include "Arduino.h"
19 #include "CorsairLightingProtocolConstants.h"
20 #include "CorsairLightingProtocolController.h"
21 #include "CorsairLightingProtocolResponse.h"
22 #include "RawHID.h"
23 
24 #if defined(SUPPORT_RAW_HID)
25 
26 #if defined(DEBUG) && defined(VERBOSE)
27 extern bool printCommand;
28 extern bool printResponse;
29 #endif
30 
36 public:
49  CorsairLightingProtocolHID(CorsairLightingProtocolController* controller, const char* serialNumber);
53  void update();
54 
55 protected:
56  uint8_t rawhidData[COMMAND_SIZE];
57  CorsairLightingProtocolController* const controller;
58 
59  bool available() const;
60  void getCommand(Command& command);
61  void sendX(const uint8_t* data, const size_t x) const override;
62 };
63 
64 #endif
Definition: CorsairLightingProtocolController.h:31
Definition: CorsairLightingProtocolHID.h:35
void update()
Definition: CorsairLightingProtocolHID.cpp:36
void sendX(const uint8_t *data, const size_t x) const override
Definition: CorsairLightingProtocolHID.cpp:61
CorsairLightingProtocolHID(CorsairLightingProtocolController *controller)
Definition: CorsairLightingProtocolHID.cpp:25
Definition: CorsairLightingProtocolResponse.h:20
Definition: CorsairLightingProtocolConstants.h:110