// GetDepDataResp getDepDataResp = tamaCommunicator.sendMessage(new GetDepDataReq());
// if (getDepDataResp.getDataIn().length != 0)
// throw new IOException("unexpected data received");
if (in.available() == 0) {
tamaCommunicator.sendMessage(new SetDepDataReq(sendBuffer, 0, 0));
}
else {
while (in.available() > 0) {
int dataRead = in.read(sendBuffer, 0, sendBuffer.length);
boolean moreInformationToSend = sendBuffer.length == dataRead && in.available() > 0;
log.debug("Sending data... " + dataRead + " more to send: " + moreInformationToSend);
log.debug("Send data: " + NfcUtils.convertBinToASCII(sendBuffer, 0, dataRead));
if (moreInformationToSend)
tamaCommunicator.sendMessage(new SetMetaDepDataReq(sendBuffer, 0, dataRead));
else {
tamaCommunicator.sendMessage(new SetDepDataReq(sendBuffer, 0, dataRead));
}
}
}
}