mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2025-12-26 16:57:51 -05:00
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#include "AsusTUFLaptopLinuxController.h"
|
|
|
|
#include <string>
|
|
|
|
void AsusTUFLaptopLinuxController::SendUpdate
|
|
(
|
|
unsigned char mode,
|
|
unsigned char speed,
|
|
unsigned char save,
|
|
unsigned char red,
|
|
unsigned char green,
|
|
unsigned char blue
|
|
)
|
|
{
|
|
std::string s = "";
|
|
s.append(ASUS_KBD_BACKLIGHT_BASE_PATH);
|
|
s.append(ASUS_KBD_BACKLIGHT_MODE_PATH);
|
|
FILE *controller = fopen(s.c_str(), "w");
|
|
|
|
s = "";
|
|
s.append(std::to_string(save));
|
|
s.append(" ");
|
|
s.append(std::to_string(mode));
|
|
s.append(" ");
|
|
s.append(std::to_string(red));
|
|
s.append(" ");
|
|
s.append(std::to_string(green));
|
|
s.append(" ");
|
|
s.append(std::to_string(blue));
|
|
s.append(" ");
|
|
s.append(std::to_string(speed));
|
|
|
|
fputs(s.c_str(), controller);
|
|
|
|
fclose(controller);
|
|
}
|
|
|
|
void AsusTUFLaptopLinuxController::SendBrightness
|
|
(
|
|
unsigned char brightness
|
|
)
|
|
{
|
|
std::string s = "";
|
|
s.append(ASUS_KBD_BACKLIGHT_BASE_PATH);
|
|
s.append(ASUS_KBD_BACKLIGHT_BRIGHTNESS_PATH);
|
|
FILE *controller = fopen(s.c_str(), "w");
|
|
|
|
fputs(std::to_string(brightness).c_str(), controller);
|
|
|
|
fclose(controller);
|
|
}
|