Store name in BloodyB820RController to avoid setting it in detector

This commit is contained in:
Adam Honse
2025-08-01 11:37:40 -05:00
parent 9c26f79ca6
commit b8628bb495
4 changed files with 12 additions and 5 deletions

View File

@@ -20,10 +20,11 @@
| the second packet. |
\*-------------------------------------------------------------------------------------*/
BloodyB820RController::BloodyB820RController(hid_device* dev_handle, const char* path)
BloodyB820RController::BloodyB820RController(hid_device* dev_handle, const char* path, std::string dev_name)
{
dev = dev_handle;
location = path;
name = dev_name;
SendControlPacket(BLOODY_B820R_GAIN_CONTROL);
}
@@ -52,6 +53,11 @@ std::string BloodyB820RController::GetLocation()
return("HID: " + location);
}
std::string BloodyB820RController::GetName()
{
return(name);
}
void BloodyB820RController::SendControlPacket(uint8_t data)
{
uint8_t buffer[BLOODY_B820R_PACKET_SIZE] = { 0x07, 0x03, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 };