final NdefListener initiatorNdefListener, final NdefPushLlcpService targetNdefPushLlcpService) {
final NfcipConnectionDummy initiator = new NfcipConnectionDummy(true, LlcpConstants.initiatorGeneralBytes);
final NfcipConnectionDummy target = new NfcipConnectionDummy(false, LlcpConstants.initiatorGeneralBytes);
initiator.setOther(target);
target.setOther(initiator);
initiatorLlcp = new LlcpOverNfcip(new LlcpConnectionManagerFactory() {
@Override
protected void configureConnectionManager(LlcpConnectionManager connectionManager) {
if (snepServer != null) {
connectionManager.registerWellKnownServiceAccessPoint(SnepConstants.SNEP_SERVICE_NAME, snepServer);
connectionManager.registerServiceAccessPoint(SnepConstants.SNEP_SERVICE_ADDRESS, snepServer);
}
if (initiatorNdefListener != null) {
NdefPushLlcpService ndefPushLlcpService = new NdefPushLlcpService(initiatorNdefListener);
connectionManager.registerWellKnownServiceAccessPoint(LlcpConstants.COM_ANDROID_NPP,
ndefPushLlcpService);
}
}
});
targetLlcp = new LlcpOverNfcip(new LlcpConnectionManagerFactory() {
@Override
protected void configureConnectionManager(LlcpConnectionManager connectionManager) {
if (snepClient != null)
connectionManager.registerServiceAccessPoint(snepClient);