#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <hidapi/hidapi.h>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <iostream>
|
|
|
|
#define MAX_STR 255
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
int brightness;
|
|
std::stringstream(argv[1]) >> brightness;
|
|
brightness++;
|
|
brightness *= 0xF;
|
|
|
|
int res;
|
|
unsigned char buf[2];
|
|
wchar_t wstr[MAX_STR];
|
|
hid_device *handle;
|
|
int i;
|
|
|
|
// Initialize the hidapi library
|
|
res = hid_init();
|
|
|
|
// Open the device using the VID, PID,
|
|
// and optionally the Serial number.
|
|
handle = hid_open(0x10c4, 0x83ce, NULL);
|
|
|
|
buf[0] = 0x06;
|
|
buf[1] = brightness;
|
|
res = hid_write(handle, buf, 2);
|
|
|
|
res = hid_exit();
|
|
|
|
return 0;
|
|
}
|
|
|