NOTCONNECTED
if (currentstate != NOTCONNECTED)
static int currentstate = NOTCONNECTED; /* START, SEND, or DONE */
if ( currentstate != NOTCONNECTED )