Search in sources :

Example 1 with ProtocolMessage

use of nfc.sample.tictactoe.protocol.ProtocolMessage in project Samples-for-Java by blackberry.

the class NfcReceiver method onNDEFMessageDetected.

public void onNDEFMessageDetected(NDEFMessage msg) {
    NDEFRecord[] records = msg.getRecords();
    if (records.length > 0) {
        byte[] payload = records[0].getPayload();
        Utilities.log("XXXX NfcReceiver payload=" + ByteArrayUtilities.byteArrayToHex(payload));
        ProtocolMessage pmsg = ProtocolMessage.makeMessage(payload);
        _processor.gameMessage(pmsg);
    }
}
Also used : NDEFRecord(net.rim.device.api.io.nfc.ndef.NDEFRecord) ProtocolMessage(nfc.sample.tictactoe.protocol.ProtocolMessage)

Aggregations

NDEFRecord (net.rim.device.api.io.nfc.ndef.NDEFRecord)1 ProtocolMessage (nfc.sample.tictactoe.protocol.ProtocolMessage)1