Package org.nfctools.ndef.wkt.records

Examples of org.nfctools.ndef.wkt.records.WellKnownRecord


    switch (carrierTypeFormat) {
      case WellKnown: {
        // NFC Forum well-known type [NFC RTD]
        if (carrierType instanceof WellKnownRecord) {
          WellKnownRecord abstractWellKnownRecord = (WellKnownRecord)carrierType;

          encoded = messageEncoder.encodeSingle(abstractWellKnownRecord);

          break;
        }
View Full Code Here


  @Override
  public WellKnownRecord decodeRecord(NdefRecord ndefRecord, NdefMessageDecoder messageDecoder) {
    WellKnownRecordConfig config = recordDecoders.get(new RecordType(ndefRecord.getType()));
    if (config != null) {
      WellKnownRecordPayloadDecoder payloadDecoder = config.getPayloadDecoder();
      WellKnownRecord record = payloadDecoder.decodePayload(ndefRecord.getPayload(), messageDecoder);
      record.setId(ndefRecord.getId());
      return record;
    }
    else
      throw new IllegalArgumentException("Unsupported Well Known NDEF Type [" + new String(ndefRecord.getType())
          + "]");
View Full Code Here

TOP

Related Classes of org.nfctools.ndef.wkt.records.WellKnownRecord

Copyright © 2018 www.massapicom. 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.