Corsair Lighting Protocol  0.15.0
Control LEDs connected to an Arduino with iCUE
CorsairLightingProtocolHID Class Reference

#include <CorsairLightingProtocolHID.h>

+ Inheritance diagram for CorsairLightingProtocolHID:
+ Collaboration diagram for CorsairLightingProtocolHID:

Public Member Functions

 CorsairLightingProtocolHID (CorsairLightingProtocolController *controller)
 
 CorsairLightingProtocolHID (CorsairLightingProtocolController *controller, const char *serialNumber)
 
void update ()
 

Protected Member Functions

bool available () const
 
void getCommand (Command &command)
 
void sendX (const uint8_t *data, const size_t x) const override
 

Protected Attributes

uint8_t rawhidData [COMMAND_SIZE]
 
CorsairLightingProtocolController *const controller
 

Detailed Description

The HID Adapter for CorsairLightingProtocolController. This adapter uses the USB HID interface directly to mimic a corsair device. This adapter can only be used when the USB interface is accessable by the sketch.

Constructor & Destructor Documentation

◆ CorsairLightingProtocolHID() [1/2]

CorsairLightingProtocolHID::CorsairLightingProtocolHID ( CorsairLightingProtocolController controller)

Create a new adapter for CorsairLightingProtocolController using the default Serial Number.

Parameters
controllerthe CorsairLightingProtocolController

◆ CorsairLightingProtocolHID() [2/2]

CorsairLightingProtocolHID::CorsairLightingProtocolHID ( CorsairLightingProtocolController controller,
const char *  serialNumber 
)

Create a new adapter for using the given Serial Number for the usb interface.

Parameters
controllerthe CorsairLightingProtocolController
serialNumberthe Serial Number used for the USB interface

Member Function Documentation

◆ sendX()

void CorsairLightingProtocolHID::sendX ( const uint8_t *  data,
const size_t  x 
) const
overrideprotectedvirtual

Send some bytes data via the CorsairLightingProtocol.

Parameters
datathe array with the data
xthe length of the array which should be send.

Implements CorsairLightingProtocolResponse.

◆ update()

void CorsairLightingProtocolHID::update ( )

Read commands form HID interface and pass them to the contoller. This function must be called in loop.


The documentation for this class was generated from the following files: