From 0907768ba5280aad723293f507e4c06348a1eef9 Mon Sep 17 00:00:00 2001 From: henyxia Date: Tue, 21 Apr 2015 12:41:14 +0200 Subject: [PATCH] Displaying some color --- main.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index f190379..c34cac4 100644 --- a/main.c +++ b/main.c @@ -1,16 +1,19 @@ #include #include +#include #include -#define VENDOR_ID 0xfccf -#define PRODUCT_ID 0xa001 +#define VENDOR_ID 0xfccf +#define PRODUCT_ID 0xa001 +#define ENDPOINT_OUT 0x01 +#define MAX_SIZE_OUT 64 + +libusb_device_handle* screenHandle; bool initUI(void) { int ret; - libusb_device_handle* screenHandle; - ret = libusb_init(NULL); if(ret != 0) { @@ -96,8 +99,23 @@ bool initUI(void) int main(void) { + int transfered; + if(!initUI()) + { printf("Unable to initialize the UI\n"); + return 1; + } + + printf("Screen Initialized\n"); + + sleep(2); + + printf("Sending command\n"); + + //libusb_bulk_transfer(screenHandle, ENDPOINT_OUT, data, MAX_SIZE_OUT, &transfered, 0); + unsigned char data[] = {0x81, 0x07, 0xFF}; + libusb_bulk_transfer(screenHandle, ENDPOINT_OUT, data, 3, &transfered, 0); return 0; } -- libgit2 0.21.2