I have C code to open the USB and set up the CrazyRadio. I think that's working OK. I don't really have a way to test that!
So, I was writing a function to scan the radio channels and see if I can find the CF2. I've tried a pile of stuff and finally have to ask for help. Should this function work if all the rest of my code is working to set up the radio?
unsigned char b;
unsigned char a;
unsigned char c;
r = libusb_control_transfer(dev_handle, 0x40, 0x21, 0, 125, (unsigned char*)&a, 3, 1000);
printf("error writing scan command\n");
printf("wrote %d bytes to command a scan...\n",r);
sleep(2); // in case the scan takes some time
r = libusb_control_transfer(dev_handle, 0xC0, 0x21, 0, 0, (unsigned char*)c, 63, 1000);
printf("got no reply from channel scan\n");
printf("error reading scan results\n");
printf("read %d bytes of scanned channel data...\n",r);
printf("Channel %d: %d\n",r,c[r]);
1 post • Page 1 of 1