示例#1
0
        /// <summary>
        /// Gets the current connected tag.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <returns>The NfcTag object.</returns>
        /// <privilege>http://tizen.org/privilege/nfc</privilege>
        /// <exception cref="NotSupportedException">Thrown when the NFC is not supported.</exception>
        /// <exception cref="InvalidOperationException">Thrown when the method fails due to an invalid operation.</exception>
        public NfcTag GetConnectedTag()
        {
            IntPtr tagHandle = IntPtr.Zero;
            int    ret       = Interop.Nfc.GetConnectedTag(out tagHandle);

            if (ret != (int)NfcError.None)
            {
                Log.Error(Globals.LogTag, "Failed to get connected tag, Error - " + (NfcError)ret);
                NfcErrorFactory.ThrowNfcException(ret);
            }
            _tag = new NfcTag(tagHandle);

            return(_tag);
        }
示例#2
0
 internal TagDiscoveredEventArgs(NfcDiscoveredType _type, IntPtr tagHandle)
 {
     _tag = new NfcTag(tagHandle);
 }