int f_xenon_smc_receive_response(unsigned char *msg) { while (1) { if (xenon_smc_receive_message(msg)) continue; if (msg[0] == 0x83) { //xenon_smc_handle_bulk(msg); printf("I hope this worked msg = %02X%02X\n", msg[2], msg[3]); switch (msg[3]) { case 0x1E: printf("up\n"); break; case 0x1F: printf("down\n"); break; case 0x20: printf("right\n"); break; case 0x21: printf("left\n"); break; default: break; } continue; } return 0; } }
int xenon_smc_poll() { uint8_t buf[16]; memset(buf, 0, 16); if (!xenon_smc_receive_message(buf)) { if (buf[0] == 0x83) { xenon_smc_handle_bulk(buf); } return 0; } return -1; }
int xenon_smc_receive_response(unsigned char *msg) { while (1) { if (xenon_smc_receive_message(msg)) continue; /* printf("REC: "); int i; for (i = 0; i < 16; ++i) printf("%02x ", msg[i]); printf("\n"); */ if (msg[0] == 0x83) { xenon_smc_handle_bulk(msg); continue; } return 0; } }