ksksue/FTDriver — Issue #1: mSerial.begin(FTDriver.BAUD9600) crashes app if no device present
Author: tlalexander
Created: 2012-01-07 00:17:54+00:00
State: open

I'm working with a copy of FTSampleTerminal that I have modified a bit. I haven't tried it on the unmodified version but I noticed on my version that the app would crash if there was no FTDI device plugged into the tablet.

I found that the FTDriver.begin method will crash at:

setFTDIEndpoints(mInterface)

if mInterface is null.

adding:

if(mInterface==null)
return false;

above:

if(!setFTDIEndpoints(mInterface)){
return false;
}

seems to fix the issue. Not sure if thats the correct way to do it though as I'm not the best coder!