public void reSync()
{

    reSynced = false;

    //track the number of time this function is called, even if a resync is not
    //successful - this will track the number of sync errors
    reSyncCount++;

    try{
        while (byteIn.available() > 0) {
            byteIn.read(inBuffer, 0, 1);
            if (inBuffer[0] == (byte)0xaa) {reSynced = true; break;}
            }
        }
    catch(IOException e){
        logSevere(e.getMessage() + " - Error: 169");
    }

}//end of Simulator::reSync