return result;
}
public void connectAsInitiator() throws IOException {
while (true) {
InListPassiveTargetResp inListPassiveTargetResp = sendMessage(new InListPassiveTargetReq((byte)1, (byte)0,
new byte[0]));
if (inListPassiveTargetResp.getNumberOfTargets() > 0) {
log.info("TargetData: " + NfcUtils.convertBinToASCII(inListPassiveTargetResp.getTargetData()));
if (inListPassiveTargetResp.isIsoDepSupported()) {
log.info("IsoDep Supported");
byte[] selectAidApdu = createSelectAidApdu(AID_ANDROID);
DataExchangeResp resp = sendMessage(new DataExchangeReq(inListPassiveTargetResp.getTargetId(),
false, selectAidApdu, 0, selectAidApdu.length));
String dataIn = new String(resp.getDataOut());
log.info("Received: " + dataIn);
if (dataIn.startsWith("Hello")) {
exchangeData(inListPassiveTargetResp);