protected int sendMedtronicPumpRequest(byte command,byte repeat){
  try {
    if (idPump != null && idPump.length > 0) {
      byte[] readSystemTime=new byte[6 + idPump.length];
      int i=0;
      readSystemTime[0]=(byte)0x81;
      readSystemTime[1]=(byte)0x06;
      readSystemTime[2]=repeat;
      readSystemTime[3]=(byte)MedtronicConstants.MEDTRONIC_PUMP;
      for (i=0; i < idPump.length; i++)       readSystemTime[i + 4]=(byte)idPump[i];
      readSystemTime[idPump.length + 4]=command;
      readSystemTime[idPump.length + 5]=(byte)0x00;
      log.debug("pump request sent ");
      int resultWrite=mSerialDevice.write(readSystemTime);
      return resultWrite;
    }
  }
 catch (  Exception e) {
    StringBuffer sb1=new StringBuffer("");
    sb1.append("EXCEPTION!!!!!! " + e.getMessage() + " "+ e.getCause());
    for (    StackTraceElement st : e.getStackTrace()) {
      sb1.append(st.toString());
    }
    sendMessageToUI(sb1.toString(),false);
  }
  return -1;
}

protected int sendMedtronicPumpRequest ( byte command , byte repeat ) { try { if ( idPump != null && idPump . length > 0 ) { byte [ ] readSystemTime = new byte [ 6 + idPump . length ] ; int i = 0 ; readSystemTime [ 0 ] = ( byte ) 0x81 ; readSystemTime [ 1 ] = ( byte ) 0x06 ; readSystemTime [ 2 ] = repeat ; readSystemTime [ 3 ] = ( byte ) MedtronicConstants . MEDTRONIC_PUMP ; for ( i = 0 ; i < idPump . length ; i ++ ) readSystemTime [ i + 4 ] = ( byte ) idPump [ i ] ; readSystemTime [ idPump . length + 4 ] = command ; readSystemTime [ idPump . length + 5 ] = ( byte ) 0x00 ; log . debug ( "pump request sent " ) ; int resultWrite = mSerialDevice . write ( readSystemTime ) ; return resultWrite ; } } catch ( Exception e ) { StringBuffer sb1 = new StringBuffer ( "" ) ; sb1 . append ( "EXCEPTION!!!!!! " + e . getMessage ( ) + " " + e . getCause ( ) ) ; for ( StackTraceElement st : e . getStackTrace ( ) ) { sb1 . append ( st . toString ( ) ) ; } sendMessageToUI ( sb1 . toString ( ) , false ) ; } return - 1 ; }
sends a message to the serial device
