Android as host of ATtiny85 Digispark

I am working on developing an Android application that will act as the lead developer based on the Digispark Arduino development. One of the problems with the board is that it does not have a special USB controller; instead, it uses a software implementation of a low-speed USB bus.

At the same time, when I connect Digispark to the Droid Bionic , I can see how the device uses both enumerations in my own application, as well as using the USB controller application. It seems to be half the battle.

What I'm stuck right now is this. When I plug in Digispark and try to run my application, the enumeration returns with several devices matching the same VID and PID . I do not see how this is possible, but here is an example of my code and the result that I received:

Code

UsbDevice anyDevice; while(deviceIterator.hasNext()){ anyDevice = deviceIterator.next(); if(anyDevice.getVendorId() == 5824 && anyDevice.getProductId() == 1503){ device = anyDevice; Log.d(TAG, "vid and pid " + anyDevice.getVendorId() + " " + anyDevice.getProductId()); Log.d(TAG, "? " + anyDevice.getDeviceName()); Log.d(TAG, "? " + anyDevice.getDeviceId()); Log.d(TAG, "? " + anyDevice.getInterface(0).getEndpoint(0)); Log.d(TAG, "DIGI FOUND"); } } Log.i(TAG," No more devices connected."); 

Eclipse Log Out

 03-28 19:32:40.773: D/USBTest(6228): vid and pid 5824 1503 03-28 19:32:40.773: D/USBTest(6228): ? /dev/bus/usb/003/003 03-28 19:32:40.773: D/USBTest(6228): ? 3003 03-28 19:32:40.773: D/USBTest(6228): ? UsbEndpoint[mAddress=129,mAttributes=3,mMaxPacketSize=8,mInterval=10] 03-28 19:32:40.773: D/USBTest(6228): DIGI FOUND 03-28 19:32:40.773: D/USBTest(6228): vid and pid 5824 1503 03-28 19:32:40.773: D/USBTest(6228): ? /dev/bus/usb/003/005 03-28 19:32:40.773: D/USBTest(6228): ? 3005 03-28 19:32:40.773: D/USBTest(6228): ? UsbEndpoint[mAddress=129,mAttributes=3,mMaxPacketSize=8,mInterval=10] 03-28 19:32:40.773: D/USBTest(6228): DIGI FOUND 03-28 19:32:40.773: D/USBTest(6228): vid and pid 5824 1503 03-28 19:32:40.773: D/USBTest(6228): ? /dev/bus/usb/003/015 03-28 19:32:40.773: D/USBTest(6228): ? 3015 03-28 19:32:40.773: D/USBTest(6228): ? UsbEndpoint[mAddress=129,mAttributes=3,mMaxPacketSize=8,mInterval=10] 03-28 19:32:40.773: D/USBTest(6228): DIGI FOUND 03-28 19:32:40.773: I/USBTest(6228): No more devices connected. 

Is this a software problem with a combination of Digispark and Android, or a bug due to my poor software skills?

+4
source share

All Articles