}
public void run() {
_screen.logEvent("LlcpReceiver starting...");
LLCPConnectionNotifier llcp_conn_notifier = null;
LLCPConnection llcp_conn = null;
InputStream in = null;
boolean completed_ok = false;
try {
// note mode=server
_screen.logEvent("Obtaining connection notifier");
llcp_conn_notifier = (LLCPConnectionNotifier) Connector.open("urn:nfc:sn:llcpdemo;mode=server;timeout=120");
_screen.logEvent("Got LlcpConnectionNotifier");
llcp_conn = llcp_conn_notifier.acceptAndOpen();
_screen.logEvent("Got LlcpConnection");
in = llcp_conn.getInputStream();
_screen.logEvent("Got InputStream");
byte[] data = new byte[256];
int bytesRead = in.read(data, 0, 256);
_screen.logEvent("Rcvd " + data.length + " bytes of data");
String text = new String(data, "US-ASCII");