Initial commit for the Steelseries Aerox 9
This commit is contained in:
parent
c7326f73a3
commit
31c24eb649
4 changed files with 218 additions and 4 deletions
|
|
@ -0,0 +1,142 @@
|
|||
/*----------------------------------------------------------------------*\
|
||||
| SteelSeriesAerox9Controller.cpp |
|
||||
| |
|
||||
| OpenRGB controller driver for the Steelseries Aerox9 Wireless (Wired) |
|
||||
| |
|
||||
| rom4ster 11th October 2022 |
|
||||
\*---------------------------------------------------------------------*/
|
||||
|
||||
#include "SteelSeriesAerox9Controller.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
SteelSeriesAerox9Controller::SteelSeriesAerox9Controller(hid_device* dev_handle, steelseries_type proto_type, const char* path)
|
||||
: SteelSeriesMouseController(dev_handle, proto_type, path)
|
||||
{
|
||||
SendInit();
|
||||
}
|
||||
|
||||
SteelSeriesAerox9Controller::~SteelSeriesAerox9Controller()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
void SteelSeriesAerox9Controller::SendInit()
|
||||
{
|
||||
/*-----------------------------------------------------------------*\
|
||||
| This sets sensitivity and allows software mode?? max 5 uint8 |
|
||||
| buffer[2] = Count eg. 0 thru 5 |
|
||||
| buffer[4] to [8] = dpi / 50 range = 0x04 - 0xC7 eg. 400 = 0x08 |
|
||||
\*-----------------------------------------------------------------*/
|
||||
uint8_t buffer[STEELSERIES_AEORX9_PACKET_SIZE] = { 0x00, 0x2D };
|
||||
|
||||
hid_send_feature_report(dev, buffer, STEELSERIES_AEORX9_PACKET_SIZE);
|
||||
}
|
||||
|
||||
std::string SteelSeriesAerox9Controller::GetFirmwareVersion()
|
||||
{
|
||||
uint8_t result = 0;
|
||||
const uint8_t CMD = 0x90;
|
||||
const uint8_t sz = 16;
|
||||
char version[sz];
|
||||
|
||||
uint8_t buffer[STEELSERIES_AEORX9_PACKET_SIZE] = { 0x00, CMD, 0x00 };
|
||||
|
||||
hid_send_feature_report(dev, buffer, STEELSERIES_AEORX9_PACKET_SIZE);
|
||||
do
|
||||
{
|
||||
result = hid_read_timeout(dev, buffer, STEELSERIES_AEORX9_PACKET_SIZE, STEELSERIES_AEORX9_TIMEOUT);
|
||||
LOG_DEBUG("[%s] Reading version buffer: Bytes Read %d Buffer %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", device_name, result,
|
||||
buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7], buffer[8], buffer[9], buffer[10]);
|
||||
} while(result > 0 && buffer[0] != CMD);
|
||||
|
||||
if(buffer[0] == CMD)
|
||||
{
|
||||
/*-----------------------------------------------------------------*\
|
||||
| Read the version from the second character |
|
||||
\*-----------------------------------------------------------------*/
|
||||
memcpy(version, &buffer[1], sz);
|
||||
std::string tmp = std::string(version);
|
||||
LOG_DEBUG("[%s] Version: %s as string %s", device_name, version, tmp.c_str());
|
||||
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("[%s] Unable to get version: giving up!", device_name);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
steelseries_mouse SteelSeriesAerox9Controller::GetMouse()
|
||||
{
|
||||
return aerox_9;
|
||||
}
|
||||
|
||||
void SteelSeriesAerox9Controller::SetLightEffectAll(uint8_t /*effect*/)
|
||||
{
|
||||
/*-----------------------------------------------------------------*\
|
||||
| Not used by this device |
|
||||
\*-----------------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void SteelSeriesAerox9Controller::SetColor
|
||||
(
|
||||
unsigned char zone_id,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue,
|
||||
unsigned char brightness
|
||||
)
|
||||
{
|
||||
|
||||
uint8_t buffer[STEELSERIES_AEORX9_PACKET_SIZE] =
|
||||
{
|
||||
0x00,
|
||||
0x21
|
||||
};
|
||||
|
||||
buffer[0x02] = 0x1;
|
||||
uint8_t offset = 0x3;
|
||||
|
||||
if (zone_id == 3)
|
||||
{
|
||||
offset = 0x3;
|
||||
buffer[0x01] = 0x26;
|
||||
buffer[offset] = 0x00;
|
||||
} else {
|
||||
buffer[offset] = zone_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
buffer[offset + 1] = red;
|
||||
buffer[offset + 2] = green;
|
||||
buffer[offset + 3] = blue;
|
||||
|
||||
hid_write(dev, buffer, STEELSERIES_AEORX9_PACKET_SIZE);
|
||||
|
||||
if(brightness != current_brightness)
|
||||
{
|
||||
SetBrightness(brightness);
|
||||
current_brightness = brightness;
|
||||
}
|
||||
Save();
|
||||
}
|
||||
|
||||
void SteelSeriesAerox9Controller::SetBrightness(uint8_t brightness)
|
||||
{
|
||||
uint8_t buffer[STEELSERIES_AEORX9_PACKET_SIZE] = { 0x00, 0x23, brightness };
|
||||
|
||||
hid_write(dev, buffer, STEELSERIES_AEORX9_PACKET_SIZE);
|
||||
}
|
||||
|
||||
void SteelSeriesAerox9Controller::Save()
|
||||
{
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
| Save packet was not confirmed as working but packet is verified as correct. |
|
||||
| https://github.com/flozz/rivalcfg/blob/master/rivalcfg/devices/aerox3.py#L141 |
|
||||
\*---------------------------------------------------------------------------------*/
|
||||
uint8_t buffer2[STEELSERIES_AEORX9_PACKET_SIZE] = { 0x00, 0x11, 0x00 };
|
||||
|
||||
hid_write(dev, buffer2, STEELSERIES_AEORX9_PACKET_SIZE);
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/*----------------------------------------------------------------------*\
|
||||
| SteelSeriesAerox9Controller.h |
|
||||
| |
|
||||
| OpenRGB controller driver for the Steelseries Aerox9 Wireless (Wired) |
|
||||
| |
|
||||
| rom4ster 11th October 2022 |
|
||||
\*---------------------------------------------------------------------*/
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "SteelSeriesGeneric.h"
|
||||
#include "SteelSeriesMouseController.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
#define STEELSERIES_AEORX9_PACKET_SIZE 65
|
||||
#define STEELSERIES_AEORX9_TIMEOUT 250
|
||||
|
||||
static const steelseries_mouse aerox_9 =
|
||||
{
|
||||
{ 0x04 },
|
||||
{
|
||||
{"Front", 0 },
|
||||
{"Middle", 1 },
|
||||
{"Rear", 2 },
|
||||
{"Reactive", 3 },
|
||||
}
|
||||
};
|
||||
|
||||
class SteelSeriesAerox9Controller: public SteelSeriesMouseController
|
||||
{
|
||||
public:
|
||||
SteelSeriesAerox9Controller(hid_device* dev_handle, steelseries_type proto_type, const char* path);
|
||||
~SteelSeriesAerox9Controller();
|
||||
|
||||
std::string GetFirmwareVersion();
|
||||
steelseries_mouse GetMouse();
|
||||
|
||||
void Save() override;
|
||||
void SetLightEffectAll(uint8_t effect);
|
||||
void SetColor
|
||||
(
|
||||
unsigned char zone_id,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue,
|
||||
unsigned char brightness
|
||||
);
|
||||
private:
|
||||
void SendInit();
|
||||
void SetBrightness(uint8_t brightness);
|
||||
uint8_t current_brightness;
|
||||
};
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
#include "SteelSeriesSenseiController.h"
|
||||
#include "SteelSeriesGeneric.h"
|
||||
#include "SteelSeriesArctis5Controller.h"
|
||||
#include "SteelSeriesAerox9Controller.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_SteelSeriesRival.h"
|
||||
#include "RGBController_SteelSeriesRival3.h"
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
| Mouse product IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define STEELSERIES_AEROX_3_PID 0x1836
|
||||
#define STEELSERIES_AEROX_9_PID 0x185A
|
||||
#define STEELSERIES_RIVAL_100_PID 0x1702
|
||||
#define STEELSERIES_RIVAL_100_DOTA_PID 0x170c
|
||||
#define STEELSERIES_RIVAL_105_PID 0x1814
|
||||
|
|
@ -95,6 +97,18 @@ void DetectSteelSeriesAerox3(hid_device_info* info, const std::string& name)
|
|||
}
|
||||
}
|
||||
|
||||
void DetectSteelSeriesAerox9(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
if(dev)
|
||||
{
|
||||
SteelSeriesAerox9Controller* controller = new SteelSeriesAerox9Controller(dev, AEROX_3, info->path);
|
||||
RGBController_SteelSeriesRival3* rgb_controller = new RGBController_SteelSeriesRival3(controller);
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
void DetectSteelSeriesApexTZone(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
|
@ -282,6 +296,7 @@ void DetectSteelSeriesArctis5(hid_device_info* info, const std::string& name)
|
|||
| Mice |
|
||||
\*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
REGISTER_HID_DETECTOR_IPU("SteelSeries Aerox 3 Wired", DetectSteelSeriesAerox3, STEELSERIES_VID, STEELSERIES_AEROX_3_PID, 3, 0xFFC0, 1 );
|
||||
REGISTER_HID_DETECTOR_IPU("SteelSeries Aerox 9 Wired", DetectSteelSeriesAerox9, STEELSERIES_VID, STEELSERIES_AEROX_9_PID, 3, 0xFFC0, 1 );
|
||||
REGISTER_HID_DETECTOR_I("SteelSeries Rival 100", DetectSteelSeriesRival100, STEELSERIES_VID, STEELSERIES_RIVAL_100_PID, 0 );
|
||||
REGISTER_HID_DETECTOR_I("SteelSeries Rival 100 DotA 2 Edition", DetectSteelSeriesRival100, STEELSERIES_VID, STEELSERIES_RIVAL_100_DOTA_PID, 0 );
|
||||
REGISTER_HID_DETECTOR_I("SteelSeries Rival 105", DetectSteelSeriesRival100, STEELSERIES_VID, STEELSERIES_RIVAL_105_PID, 0 );
|
||||
|
|
|
|||
10
OpenRGB.pro
10
OpenRGB.pro
|
|
@ -176,8 +176,6 @@ contains(QMAKE_PLATFORM, freebsd) {
|
|||
|
||||
HEADERS += \
|
||||
Colors.h \
|
||||
Controllers/LianLiController/LianLiUniHub_AL10Controller.h \
|
||||
Controllers/LianLiController/RGBController_LianLiUniHub_AL10.h \
|
||||
dependencies/ColorWheel/ColorWheel.h \
|
||||
dependencies/Swatches/swatches.h \
|
||||
dependencies/json/json.hpp \
|
||||
|
|
@ -449,11 +447,13 @@ HEADERS +=
|
|||
Controllers/LIFXController/LIFXController.h \
|
||||
Controllers/LIFXController/RGBController_LIFX.h \
|
||||
Controllers/LianLiController/LianLiUniHubController.h \
|
||||
Controllers/LianLiController/LianLiUniHub_AL10Controller.h \
|
||||
Controllers/LianLiController/RGBController_LianLiUniHub.h \
|
||||
Controllers/LianLiController/RGBController_StrimerLConnect.h \
|
||||
Controllers/LianLiController/StrimerLConnectController.h \
|
||||
Controllers/LianLiController/LianLiUniHubALController.h \
|
||||
Controllers/LianLiController/RGBController_LianLiUniHubAL.h \
|
||||
Controllers/LianLiController/RGBController_LianLiUniHub_AL10.h \
|
||||
Controllers/LogitechController/LogitechProtocolCommon.h \
|
||||
Controllers/LogitechController/LogitechG203LController.h \
|
||||
Controllers/LogitechController/LogitechG213Controller.h \
|
||||
|
|
@ -567,6 +567,7 @@ HEADERS +=
|
|||
Controllers/SRGBmodsController/RGBController_SRGBmodsPico.h \
|
||||
Controllers/SteelSeriesController/color32.h \
|
||||
Controllers/SteelSeriesController/SteelSeriesAerox3Controller.h \
|
||||
Controllers/SteelSeriesController/SteelSeriesAerox9Controller.h \
|
||||
Controllers/SteelSeriesController/SteelSeriesApexBaseController.h \
|
||||
Controllers/SteelSeriesController/SteelSeriesApexController.h \
|
||||
Controllers/SteelSeriesController/SteelSeriesApexMController.h \
|
||||
|
|
@ -633,8 +634,6 @@ contains(QMAKE_PLATFORM, freebsd) {
|
|||
}
|
||||
|
||||
SOURCES += \
|
||||
Controllers/LianLiController/LianLiUniHub_AL10Controller.cpp \
|
||||
Controllers/LianLiController/RGBController_LianLiUniHub_AL10.cpp \
|
||||
dependencies/Swatches/swatches.cpp \
|
||||
dependencies/dmiinfo.cpp \
|
||||
dependencies/ColorWheel/ColorWheel.cpp \
|
||||
|
|
@ -993,8 +992,10 @@ SOURCES +=
|
|||
Controllers/LIFXController/LIFXControllerDetect.cpp \
|
||||
Controllers/LIFXController/RGBController_LIFX.cpp \
|
||||
Controllers/LianLiController/LianLiControllerDetect.cpp \
|
||||
Controllers/LianLiController/LianLiUniHub_AL10Controller.cpp \
|
||||
Controllers/LianLiController/LianLiUniHubController.cpp \
|
||||
Controllers/LianLiController/RGBController_LianLiUniHub.cpp \
|
||||
Controllers/LianLiController/RGBController_LianLiUniHub_AL10.cpp \
|
||||
Controllers/LianLiController/RGBController_StrimerLConnect.cpp \
|
||||
Controllers/LianLiController/StrimerLConnectController.cpp \
|
||||
Controllers/LianLiController/LianLiUniHubALController.cpp \
|
||||
|
|
@ -1136,6 +1137,7 @@ SOURCES +=
|
|||
Controllers/SRGBmodsController/SRGBmodsControllerDetect.cpp \
|
||||
Controllers/SRGBmodsController/RGBController_SRGBmodsPico.cpp \
|
||||
Controllers/SteelSeriesController/SteelSeriesAerox3Controller.cpp \
|
||||
Controllers/SteelSeriesController/SteelSeriesAerox9Controller.cpp \
|
||||
Controllers/SteelSeriesController/SteelSeriesApexController.cpp \
|
||||
Controllers/SteelSeriesController/SteelSeriesApexMController.cpp \
|
||||
Controllers/SteelSeriesController/SteelSeriesApexTZoneController.cpp \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue