Datasheet

Preconditions
A read request is not already in progress and an Android device is attached.
Parameters
Parameters Description
void* handle the handle passed to the device in the EVENT_ANDROID_ATTACH ( see
page 33) event
BYTE* data a pointer to the location of where the data should be stored. This location
should be accessible by the USB module
DWORD size the amount of data to read.
Return Values
Return Values Description
USB_SUCCESS Read started successfully.
USB_UNKNOWN_DEVICE Device with the specified address not found.
USB_INVALID_STATE We are not in a normal running state.
USB_ENDPOINT_ILLEGAL_TYPE Must use USBHostControlRead to read from a control endpoint.
USB_ENDPOINT_ILLEGAL_DIRECTION Must read from an IN endpoint.
USB_ENDPOINT_STALLED Endpoint is stalled. Must be cleared by the application.
USB_ENDPOINT_ERROR Endpoint has too many errors. Must be cleared by the application.
USB_ENDPOINT_BUSY A Read is already in progress.
USB_ENDPOINT_NOT_FOUND Invalid endpoint.
USB_ERROR_BUFFER_TOO_SMALL (
see page 29)
The buffer passed to the read function was smaller than the endpoint size being
used (buffer must be larger than or equal to the endpoint size).
Function
BYTE AndroidAppRead(void* handle, BYTE* data, DWORD size)
5.1.4 AndroidAppStart Function
Sets the accessory information and initializes the client driver information after the initial power cycles.
File
usb_host_android.h
C
void AndroidAppStart(
ANDROID_ACCESSORY_INFORMATION* accessoryInfo
);
Description
Sets the accessory information and initializes the client driver information after the initial power cycles. Since this resets all
device information this function should be used only after a compete system reset. This should not be called while the USB
is active or while connected to a device.
Remarks
None
Preconditions
USB module should not be in operation
Microchip's Accessory Framework for Android(tm) 25
25
5