-#if 0
- ret = rawhid_open(1, 0x16C0, 0x0486, 0xFFC9, 0x0004);
- if (ret <= 0) {
- fprintf(stderr, "dbg rawhid is missing\n");
- return 1;
- }
-
- ret = rawhid_open(1, 0x16C0, 0x0486, 0xFFAB, 0x0200);
- if (ret <= 0) {
- fprintf(stderr, "data rawhid is missing\n");
- return 1;
- }
-
- pthread_t thread;
- ret = pthread_create(&thread, NULL, dbg_reader, NULL);
- if (ret) {
- fprintf(stderr, "pthread_create failed: %d\n", ret);
- return 1;
- }
-
- memset(buf, 0, sizeof(buf));
- snprintf(buf, sizeof(buf), "hi");
-
- ret = rawhid_send(1, buf, 64, 220);
- if (ret != 64) {
- fprintf(stderr, "send failed: %d\n", ret);
- }
-
- while (1) {
- // check if any Raw HID packet has arrived
- ret = rawhid_recv(1, buf, 64, 220);
- if (ret < 0) {
- fprintf(stderr, "\nrawhid_recv(1): %d\n", ret);
- break;
- }
- if (ret > 0) {
- printf("\nrecv %d bytes:\n", ret);
- for (i=0; i<ret; i++) {
- printf("%02X ", buf[i] & 255);
- if (i % 16 == 15 && i < ret-1) printf("\n");
- }
- printf("\n");
- }
- }
-
- // rawhid_close(1);
-
- g_quit = 1;
- pthread_join(thread, NULL);
-#endif
-