mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 22:45:55 -04:00
Store and print configuration table for Aura Addressable controller
This commit is contained in:
@@ -26,6 +26,7 @@ AuraAddressableController::AuraAddressableController(hid_device* dev_handle)
|
||||
dev = dev_handle;
|
||||
|
||||
GetFirmwareVersion();
|
||||
GetConfigTable();
|
||||
}
|
||||
|
||||
AuraAddressableController::~AuraAddressableController()
|
||||
@@ -92,6 +93,46 @@ void AuraAddressableController::SetMode
|
||||
);
|
||||
}
|
||||
|
||||
void AuraAddressableController::GetConfigTable()
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up config table request packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0xEC;
|
||||
usb_buf[0x01] = AURA_REQUEST_CONFIG_TABLE;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, 65);
|
||||
hid_read(dev, usb_buf, 65);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy the firmware string if the reply ID is correct |
|
||||
\*-----------------------------------------------------*/
|
||||
if(usb_buf[1] == 0x30)
|
||||
{
|
||||
memcpy(config_table, &usb_buf[4], 60);
|
||||
|
||||
for(int i = 0; i < 60; i+=6)
|
||||
{
|
||||
printf("%02X %02X %02X %02X %02X %02X\r\n", config_table[i + 0],
|
||||
config_table[i + 1],
|
||||
config_table[i + 2],
|
||||
config_table[i + 3],
|
||||
config_table[i + 4],
|
||||
config_table[i + 5]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AuraAddressableController::GetFirmwareVersion()
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
|
||||
std::string GetDeviceName();
|
||||
|
||||
int GetChannelCount();
|
||||
|
||||
void SetLEDsDirect(std::vector<RGBColor> colors);
|
||||
|
||||
void SetMode
|
||||
@@ -61,9 +63,12 @@ public:
|
||||
|
||||
private:
|
||||
char device_name[16];
|
||||
unsigned char config_table[60];
|
||||
hid_device* dev;
|
||||
unsigned int led_count;
|
||||
|
||||
void GetConfigTable();
|
||||
|
||||
void GetFirmwareVersion();
|
||||
|
||||
void SendEffect
|
||||
|
||||
Reference in New Issue
Block a user