コード例 #1
0
        /// <summary>
        /// Deletes any details currently stored in the Handover Select record
        /// and re-initializes them by parsing the contents of the payload.
        /// </summary>
        private void ParsePayloadToData(byte[] payload)
        {
            if (payload == null || payload.Length < 1)
            {
                throw new NdefException(NdefExceptionMessages.ExHandoverInvalidVersion);
            }
            // Parse Handover version (byte 0)
            _handoverVersion = new NdefHandoverVersion(payload[0]);

            // Parse child records (bytes 1+)
            var childRecordMsg = new Byte[payload.Length - 1];

            Array.Copy(payload, 1, childRecordMsg, 0, payload.Length - 1);
            SetAndAssignChildRecords(childRecordMsg);
        }
コード例 #2
0
 /// <summary>
 /// Create a Handover Select record based on the specified version number and
 /// supplying an alternative carrier record.
 /// </summary>
 /// <param name="version">Version to use for the handover select record.</param>
 /// <param name="alternativeCarrier">A single alternative carrier record. If you want
 /// to add multiple alternative carrier records, use the AddHandoverAlternativeCarrierRecord()
 /// method.</param>
 public NdefHandoverSelectRecord(NdefHandoverVersion version, NdefHandoverAlternativeCarrierRecord alternativeCarrier)
     : base(TypeNameFormatType.NfcRtd, BtHsType)
 {
     _handoverVersion = version;
     AddHandoverAlternativeCarrierRecord(alternativeCarrier);
 }
コード例 #3
0
 /// <summary>
 /// Create a Handover Select record based on the specified version number.
 /// </summary>
 /// <remarks>
 /// To use the Handover Select record, you also need to supply at least
 /// one Alternative Carrier record.</remarks>
 /// <param name="version">Version to use for the handover select record.</param>
 public NdefHandoverSelectRecord(NdefHandoverVersion version)
     : base(TypeNameFormatType.NfcRtd, BtHsType)
 {
     _handoverVersion = version;
 }
コード例 #4
0
 /// <summary>
 /// Deletes any details currently stored in the Handover Select record 
 /// and re-initializes them by parsing the contents of the payload.
 /// </summary>
 private void ParsePayloadToData(byte[] payload)
 {
     if (payload == null || payload.Length < 1)
     {
         throw new NdefException(NdefExceptionMessages.ExHandoverInvalidVersion);
     }
     // Parse Handover version (byte 0)
     _handoverVersion = new NdefHandoverVersion(payload[0]);
     
     // Parse child records (bytes 1+)
     var childRecordMsg = new byte[payload.Length - 1];
     Array.Copy(payload, 1, childRecordMsg, 0, payload.Length - 1);
     SetAndAssignChildRecords(childRecordMsg);
 }
コード例 #5
0
 /// <summary>
 /// Create a Handover Select record based on the specified version number and 
 /// supplying an alternative carrier record.
 /// </summary>
 /// <param name="version">Version to use for the handover select record.</param>
 /// <param name="alternativeCarrier">A single alternative carrier record. If you want
 /// to add multiple alternative carrier records, use the AddHandoverAlternativeCarrierRecord()
 /// method.</param>
 public NdefHandoverSelectRecord(NdefHandoverVersion version, NdefHandoverAlternativeCarrierRecord alternativeCarrier)
     : base(TypeNameFormatType.NfcRtd, BtHsType)
 {
     _handoverVersion = version;
     AddHandoverAlternativeCarrierRecord(alternativeCarrier);
 }
コード例 #6
0
 /// <summary>
 /// Create a Handover Select record based on the specified version number.
 /// </summary>
 /// <remarks>
 /// To use the Handover Select record, you also need to supply at least
 /// one Alternative Carrier record.</remarks>
 /// <param name="version">Version to use for the handover select record.</param>
 public NdefHandoverSelectRecord(NdefHandoverVersion version)
     : base(TypeNameFormatType.NfcRtd, BtHsType)
 {
     _handoverVersion = version;
 }