serialOut = serialPort.getOutputStream();
}
public void initDevice() throws IOException {
Log.debug(this.getClass(), "initializing device connection");
sendByteArray(new ByteArray("AT\r","ISO-8859-1"));
waitForATResponseWithOK(DEFAULT_INTERNAL_AT_RESPONSE_TIMEOUT, true);
sendByteArray(new ByteArray("ATE\r","ISO-8859-1"));
waitForATResponseWithOK(DEFAULT_INTERNAL_AT_RESPONSE_TIMEOUT, true);
sendByteArray(new ByteArray("AT\r","ISO-8859-1"));
waitForATResponseWithOK(DEFAULT_INTERNAL_AT_RESPONSE_TIMEOUT, true);
sendByteArray(new ByteArray("AT\r","ISO-8859-1"));
waitForATResponseWithOK(DEFAULT_INTERNAL_AT_RESPONSE_TIMEOUT, true);
sendByteArray(new ByteArray("ATI\r","ISO-8859-1"));
ByteArray response = waitForATResponseWithOK(DEFAULT_INTERNAL_AT_RESPONSE_TIMEOUT, true);
Log.debug(this.getClass(), " " + response.toPrintableString());
}