Datasheet

if( errorCode != USB_SUCCESS)
{
//Error
DEBUG_ERROR("Error trying to start read");
}
else
{
readInProgress = TRUE;
}
}
if(AndroidAppIsReadComplete(device_handle, &errorCode, &size) == TRUE)
{
readInProgress = FALSE;
//We've received a command over the USB from the Android device.
if(errorCode == USB_SUCCESS)
{
//We've received data, process it here (or elsewhere if desired)
switch(command_packet.command)
{
case COMMAND_SET_LEDS:
SetLEDs(command_packet.data);
break;
default:
//Error, unknown command
DEBUG_ERROR("Error: unknown command received");
break;
}
}
else
{
//Error
DEBUG_ERROR("Error trying to complete read request");
}
}
}
Microchip's Accessory Framework for Android(tm) 21
21
4