Examples of LLCPConnection


Examples of net.rim.device.api.io.nfc.llcp.LLCPConnection

    }

    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");
View Full Code Here

Examples of net.rim.device.api.io.nfc.llcp.LLCPConnection

        _message = message;
    }

    public void run() {
        _screen.logEvent("LlcpSender starting...");
        LLCPConnection llcp_conn = null;
        OutputStream out = null;
        boolean completed_ok = false;
        try {
            // note mode=client
            _screen.logEvent("Obtaining connection");
            llcp_conn = (LLCPConnection) Connector.open("urn:nfc:sn:llcpdemo;mode=client");
            _screen.logEvent("Got LlcpConnection");
            out = llcp_conn.getOutputStream();
            _screen.logEvent("Got OutputStream");
            byte[] data = _message.getBytes("US-ASCII");
            out.write(data, 0, data.length);
            out.flush();
            _screen.logEvent("Sent " + data.length + " bytes of data");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.