BOOL CheckForNewAttach ( void ) { // Try to get the device address, if we don't have one. if (deviceAddress == 0) { GENERIC_DEVICE_ID DevID; /*DevID.vid = 0x046D; DevID.pid = 0xC526;*/ DevID.vid = gc_DevData.ID.vid; DevID.pid = gc_DevData.ID.pid; #ifdef USB_GENERIC_SUPPORT_SERIAL_NUMBERS DevID.serialNumberLength = 0; DevID.serialNumber = NULL; #endif if (USBHostGenericGetDeviceAddress(&DevID)) { deviceAddress = DevID.deviceAddress; UART2PrintString( "Generic demo device attached - polled, deviceAddress=" ); UART2PutDec( deviceAddress ); UART2PrintString( "\r\n" ); UART2PrintString( "VID=" ); UART2PutHexWord(DevID.vid); UART2PrintString( "\r\n" ); UART2PrintString( "PID=" ); UART2PutHexWord(DevID.pid); UART2PrintString( "\r\n" ); return TRUE; } } return FALSE; } // CheckForNewAttach
BOOL ChipKITUSBGenericHost::GetDeviceAddress(GENERIC_DEVICE_ID *pDevID) { return(USBHostGenericGetDeviceAddress(pDevID)); }