2025-01-24 01:25:30 +03:00
|
|
|
/**********************
|
|
|
|
Dmitry Isaenko
|
|
|
|
License: GNU GPL v.3
|
|
|
|
redrise.ru, github.com/developersu
|
|
|
|
2025, Russia
|
|
|
|
***********************/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "libusb-1.0/libusb.h"
|
|
|
|
|
2025-01-27 01:55:17 +03:00
|
|
|
#include "configuration.h"
|
|
|
|
#include "device_setup.c"
|
2025-01-24 01:25:30 +03:00
|
|
|
#include "init_terminate.c"
|
|
|
|
#include "commands.c"
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
2025-01-26 00:54:18 +03:00
|
|
|
|
2025-01-27 01:55:17 +03:00
|
|
|
// if (argc < 2){
|
|
|
|
// printf("Missing arguments ('argbColors --help' for help)\n");
|
|
|
|
// return -1;
|
|
|
|
// }
|
2025-01-26 19:08:12 +03:00
|
|
|
|
2025-01-27 01:55:17 +03:00
|
|
|
int ret = configure_device();
|
|
|
|
if (ret != 0){
|
|
|
|
printf("%s - %d\n", libusb_error_name(ret), ret);
|
|
|
|
return -1;
|
2025-01-26 00:54:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (init_sequence()){
|
|
|
|
printf("Initial sequence transfer failure\n");
|
|
|
|
libusb_close(dev_handle);
|
|
|
|
return -1;
|
|
|
|
}
|
2025-01-27 01:55:17 +03:00
|
|
|
/*
|
2025-01-27 00:50:59 +03:00
|
|
|
if (cycle(0, 4)){
|
|
|
|
printf("Command transfer failure\n");
|
|
|
|
libusb_close(dev_handle);
|
|
|
|
return -1;
|
|
|
|
}
|
2025-01-27 01:55:17 +03:00
|
|
|
|
2025-01-26 19:08:12 +03:00
|
|
|
if (impulse(0, 0xff, 0x2f, 0xff)){
|
|
|
|
printf("Command transfer failure\n");
|
|
|
|
libusb_close(dev_handle);
|
|
|
|
return -1;
|
|
|
|
}
|
2025-01-27 01:55:17 +03:00
|
|
|
//*/
|
2025-01-26 19:08:12 +03:00
|
|
|
// 0xff, 0x2f, 0xff <3
|
2025-01-26 00:54:18 +03:00
|
|
|
if(staticColorSeparate(0xff, 0xff, 0x2b, 0x00)){
|
|
|
|
printf("Command transfer failure\n");
|
|
|
|
libusb_close(dev_handle);
|
|
|
|
return -1;
|
|
|
|
}
|
2025-01-27 01:55:17 +03:00
|
|
|
|
2025-01-26 00:54:18 +03:00
|
|
|
if (terminate_sequence()){
|
|
|
|
printf("Termination sequence transfer failure\n");
|
|
|
|
libusb_close(dev_handle);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
libusb_close(dev_handle);
|
|
|
|
|
|
|
|
return 0;
|
2025-01-24 01:25:30 +03:00
|
|
|
}
|