Created
August 19, 2014 06:13
-
-
Save exlee/528d418cb6d58f970a5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <wchar.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include "hidapi.h" | |
#define MAX_STR 255 | |
const unsigned char caps_switch[] = {0x0, 0x0b, 0x20, 0x07, 0x00, 0x03, 0x00, 0x40, 0x00, 0xa2, 0x01, 0x02 }; | |
#define HID_VENDOR_ID_LOGITECH 0x046d | |
#define HID_DEVICE_ID_K810 0xb319 | |
int main(int argc, char* argv[]) { | |
int res; | |
int i; | |
unsigned char buf[65]; | |
wchar_t wstr[MAX_STR]; | |
hid_device *handle; | |
res = hid_init(); | |
handle = hid_open_path("Bluetooth_046d_b319_207606bb"); | |
res = hid_write(handle, caps_switch, 12); | |
printf("Result: %d\n", res); // Returns -1 | |
hid_close(handle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment