@Override
public void onTarget(Target target, NfcContext nfcContext) throws IOException {
log.info("New target");
TamaNfcIpCommunicator nfcIpCommunicator = nfcContext.getAttribute(NfcContext.KEY_COMMUNICATOR);
// nfcIpCommunicator.setTimeout(100); // default
//
// List<Object> parameter = extractLlcParameters(target.getNfcId());
// nfcContext.setAttribute("llcparameter", parameter);
// for (Object object : parameter) {
// if (object instanceof LinkTimeOut) {
// LinkTimeOut lto = (LinkTimeOut)object;
// nfcIpCommunicator.setTimeout(lto.getValue() * 10);
// }
// }
// TODO check target general bytes for llc header
byte[] generalBytes = new byte[llcHeader.length + llcParameters.length];
System.arraycopy(llcHeader, 0, generalBytes, 0, llcHeader.length);
System.arraycopy(llcParameters, 0, generalBytes, llcHeader.length, llcParameters.length);
log.info("reply...");
Integer statusCode = nfcIpCommunicator.sendMessage(new SetGeneralBytesReq(generalBytes));
if (statusCode.intValue() != 0)
throw new IOException("status code: " + statusCode);
}