Control backlight of 51NB X330 (X230 with FHD mod)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
646 B

#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 *= 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;