Add controller for HyperX Pulsefire FPS Pro mouse (new NGenuity firmware)
This commit is contained in:
parent
5c30255a06
commit
6c3baf477c
6 changed files with 314 additions and 5 deletions
|
|
@ -0,0 +1,73 @@
|
|||
/*-----------------------------------------*\
|
||||
| HyperXPulsefireFPSProController.cpp |
|
||||
| |
|
||||
| Driver for HyperX Pulsefire FPS Pro |
|
||||
| lighting controller |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 12/26/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "HyperXPulsefireFPSProController.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
HyperXPulsefireFPSProController::HyperXPulsefireFPSProController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
}
|
||||
|
||||
HyperXPulsefireFPSProController::~HyperXPulsefireFPSProController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string HyperXPulsefireFPSProController::GetDeviceLocation()
|
||||
{
|
||||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string HyperXPulsefireFPSProController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
std::wstring return_wstring = serial_string;
|
||||
std::string return_string(return_wstring.begin(), return_wstring.end());
|
||||
|
||||
return(return_string);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------*\
|
||||
| Private packet sending functions. |
|
||||
\*-------------------------------------------------------------------------------------------------*/
|
||||
|
||||
void HyperXPulsefireFPSProController::SendDirect
|
||||
(
|
||||
RGBColor* color_data
|
||||
)
|
||||
{
|
||||
unsigned char buf[264];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(buf, 0x00, sizeof(buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Direct Mode packet |
|
||||
\*-----------------------------------------------------*/
|
||||
buf[0x00] = 0x07;
|
||||
buf[0x01] = HYPERX_PULSEFIRE_FPS_PRO_PACKET_ID_DIRECT;
|
||||
|
||||
buf[0x02] = RGBGetRValue(color_data[0]);
|
||||
buf[0x03] = RGBGetGValue(color_data[0]);
|
||||
buf[0x04] = RGBGetBValue(color_data[0]);
|
||||
|
||||
buf[0x08] = 0xA0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, buf, 264);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue