int dequeueTelegram(){
  int result=-1;
  if (txTelegramQueue.size() > 0) {
    currTxTgm=txTelegramQueue.remove(0);
    if (currTxTgm[1] != (blockCounter + 1)) {
      log.info(String.format("MsgCounter adjusted:%02x->%02x",(int)currTxTgm[1],(int)blockCounter + 1));
      currTxTgm[1]=++blockCounter;
    }
    currTxCharPos=0;
    result=0;
  }
 else {
    currTxTgm=getAckTelegram();
    currTxCharPos=0;
    result=0;
  }
  return (result);
}

int dequeueTelegram ( ) { int result = - 1 ; if ( txTelegramQueue . size ( ) > 0 ) { currTxTgm = txTelegramQueue . remove ( 0 ) ; if ( currTxTgm [ 1 ] != ( blockCounter + 1 ) ) { log . info ( String . format ( "MsgCounter adjusted:%02x->%02x" , ( int ) currTxTgm [ 1 ] , ( int ) blockCounter + 1 ) ) ; currTxTgm [ 1 ] = ++ blockCounter ; } currTxCharPos = 0 ; result = 0 ; } else { currTxTgm = getAckTelegram ( ) ; currTxCharPos = 0 ; result = 0 ; } return ( result ) ; }
dequeue next telegram to be sent
