Skip to content

Commit

Permalink
updated #defines and made some changes to wLength values and pipe wid…
Browse files Browse the repository at this point in the history
…ths passed to Control Transfer requests
  • Loading branch information
Paul Hampson committed Nov 11, 2011
1 parent 84c1e2b commit e09d35a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions module_android_aap/src/USBHostUser.c
@@ -1,6 +1,7 @@
#include "usb_descriptors.h"
#include "USBHostLLD.h"
#include "usb_host_global.h"
#include "usb_host_app_conf.h"

#define ACC_GET_PROTOCOL 51 //33
#define ACC_SEND_STRING 52 //34
Expand All @@ -27,7 +28,7 @@ int USBHost_user_vid_pid_fail( DeviceDescriptor *devicedesc, int vendorIDMask, i

// Get the protocol first, should be equal to 1
// Stage 1: Get protocol
USBLLD_ControlTransferIn(0, BRT_TYPE_VENDOR, BRT_RECIPIENT_DEVICE, ACC_GET_PROTOCOL, 0, 0, 2, 255);
USBLLD_ControlTransferIn(0, BRT_TYPE_VENDOR, BRT_RECIPIENT_DEVICE, ACC_GET_PROTOCOL, 0, 0, 255, DEFAULT_EP0_PIPE_WIDTH );

if (WaitForResponse(&usbTrans))
{
Expand All @@ -51,7 +52,7 @@ int USBHost_user_vid_pid_fail( DeviceDescriptor *devicedesc, int vendorIDMask, i
if (rv) return 2; // error sending a string

// Stage 3: Put in Acc mode & restart
USBLLD_ControlTransferInDir(0, BRT_TYPE_VENDOR, BRT_RECIPIENT_DEVICE, ACC_MODE_START, 0, 0,0, 0, 255);
USBLLD_ControlTransferInDir(0, BRT_TYPE_VENDOR, BRT_RECIPIENT_DEVICE, ACC_MODE_START, 0, 0, 0, 0, DEFAULT_EP0_PIPE_WIDTH);

if (WaitForResponse(&usbTrans))
{
Expand Down
7 changes: 5 additions & 2 deletions module_android_aap/src/usb_host_app_conf.h
Expand Up @@ -11,10 +11,13 @@
#define TIMED_EP_COUNT 0

/* Initial get descriptor length to try, will retry if length is longer */
#define INITIAL_GET_DESC_LEN 64
#define INITIAL_GET_DEV_DESC_LEN 18

/* Initial get descriptor length to try, will retry if length is longer */
#define DEFAULT_EP0_PIPE_WIDTH 64

/* Initial get configuration descriptor length to try, will retry if length is longer */
#define INITIAL_GET_CONF_DESC_LEN 250
#define INITIAL_GET_CONF_DESC_LEN 255

/* enable hook for VID/PID match failure */
#define USBHOST_VID_PID_HOOK_ON
Expand Down

0 comments on commit e09d35a

Please sign in to comment.