/// Enable card emulation mode.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void EnableCardEmulation()
{
int ret = Interop.Nfc.CardEmulation.EnableCardEmulation();
/// Disable card emulation mode.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void DisableCardEmulation()
{
int ret = Interop.Nfc.CardEmulation.DisableCardEmulatiion();
/// Give the priority to the foreground application when dispatching transaction event.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void EnableTransactionForegroundDispatch()
{
int ret = Interop.Nfc.EnableTransactionForegroundDispatch();
/// Disable foreground dispatch for "EVT_TRANSACTION" to the givin application.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void DisableTransactionForegroundDispatch()
{
int ret = Interop.Nfc.DisableTransactionForegroundDispatch();
/// <returns>'True' when application is currently the activated handler, otherwise 'False'.</returns>
/// <param name="seType">The type of Secure Element.</param>
/// <param name="aid">Application Id, specified in ISO/IEC 7816-4.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public bool IsActivatedHandlerForAid(NfcSecureElementType seType, string aid)
{
bool isActivatedHandle = false;
/// <returns>'True' when application is currently the activated handler, otherwise 'False'.</returns>
/// <param name="seType">The type of Secure Element.</param>
/// <param name="category">Enumeration value of category.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public bool IsActivatedHandlerForCategory(NfcSecureElementType seType, NfcCardEmulationCategoryType category)
{
bool isActivatedHandle = false;
/// <param name="seType">The type of Secure Element.</param>
/// <param name="category">Enumeration value of category.</param>
/// <param name="aid">Application Id, specified in ISO/IEC 7816-4.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void RegisterAid(NfcSecureElementType seType, NfcCardEmulationCategoryType category, string aid)
{
int ret = Interop.Nfc.CardEmulation.RegisterAid((int)seType, (int)category, aid);
/// <param name="seType">The type of Secure Element.</param>
/// <param name="category">Enumeration value of category.</param>
/// <param name="aid">Application Id, specified in ISO/IEC 7816-4.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void UnregisterAid(NfcSecureElementType seType, NfcCardEmulationCategoryType category, string aid)
{
int ret = Interop.Nfc.CardEmulation.UnregisterAid((int)seType, (int)category, aid);
/// Sets the application as a preferred handler.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void SetPreferredApplication()
{
int ret = Interop.Nfc.CardEmulation.SetPreferredHandler();
/// Unsets the application as a preferred handler.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void UnsetPreferredApplication()
{
int ret = Interop.Nfc.CardEmulation.UnsetPreferredHandler();
/// <returns>List of NfcRegisteredAidInformation objects.</returns>
/// <param name="seType">The type of Secure Element.</param>
/// <param name="category">Enumeration value of category.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public IEnumerable<NfcRegisteredAidInformation> GetRegisteredAidInformation(NfcSecureElementType seType, NfcCardEmulationCategoryType category)
{
List<NfcRegisteredAidInformation> infoList = new List<NfcRegisteredAidInformation>();
/// Creates a object for the access point.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public NfcNdefMessage()
{
int ret = Interop.Nfc.NdefMessage.Create(out _messageHandle);
/// <param name="id">The record ID.</param>
/// <param name="payload">The payload of this record.</param>
/// <param name="paloadLength">The byte size of payload.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public NfcNdefRecord(NfcRecordTypeNameFormat format, byte[] type, byte[] id, byte[] payload, uint paloadLength)
{
int ret = Interop.Nfc.NdefRecord.Create(out _recordHandle, (int)format, type, type.Length, id, id.Length, payload, paloadLength);
/// <param name="text">The encoded text.</param>
/// <param name="languageCode">The language code string value followed by IANA[RFC 3066] (ex: en-US, ko-KR).</param>
/// <param name="encode">The encoding type.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public NfcNdefRecord(string text, string languageCode, NfcEncodeType encode)
{
int ret = Interop.Nfc.NdefRecord.CreateText(out _recordHandle, text, languageCode, (int)encode);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="uri">The URI string that will be stored in the payload.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public NfcNdefRecord(string uri)
{
int ret = Interop.Nfc.NdefRecord.CreateUri(out _recordHandle, uri);
/// <param name="mimeType">The mime type [RFC 2046] (ex. text/plain, image/jpeg ) This value is stored in type field.</param>
/// <param name="data">The data in form of bytes array.</param>
/// <param name="dataSize">The size of data.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public NfcNdefRecord(string mimeType, byte[] data, uint dataSize)
{
int ret = Interop.Nfc.NdefRecord.CreateMime(out _recordHandle, mimeType, data, dataSize);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="ndefMessage">NfcNdefMessage object.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public Task<NfcError> SendNdefMessageAsync(NfcNdefMessage ndefMessage)
{
var task = new TaskCompletionSource<NfcError>();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>NfcP2p object.</returns>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public NfcP2p GetConnectedTarget()
{
IntPtr targetHandle = IntPtr.Zero;
/// <since_tizen> 3 </since_tizen>
/// <param name="response">The bytes array of response data.</param>
/// <param name="responseLength">The size of response bytes array.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void HceSendApduResponse(byte[] response, uint responseLength)
{
int ret = Interop.Nfc.CardEmulation.HceSendApduRespondse(_secureElementHandle, response, responseLength);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>List of NfcTagInformation objects.</returns>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public IEnumerable<NfcTagInformation> ForeachInformation()
{
List<NfcTagInformation> infoList = new List<NfcTagInformation>();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="buffer">The binary data for parameter or additional commands.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public Task<byte[]> TransceiveAsync(byte[] buffer)
{
var task = new TaskCompletionSource<byte[]>();
-
+
byte[] resultBuffer = null;
Interop.Nfc.TagTransceiveCompletedCallback callback = (int result, IntPtr resultData, int dataSize, IntPtr userData) =>
{
/// Reads NDEF formatted data from NFC tag.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public Task<NfcNdefMessage> ReadNdefMessageAsync()
{
var task = new TaskCompletionSource<NfcNdefMessage>();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="ndefMessage">The NfcNdefMessage object.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public Task<NfcError> WriteNdefMessageAsync(NfcNdefMessage ndefMessage)
{
var task = new TaskCompletionSource<NfcError>();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="keyValue">The key value that may need to format the tag.</param>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public Task<NfcError> FormatNdefMessageAsync(byte[] keyValue)
{
var task = new TaskCompletionSource<NfcError>();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>NfcTag object.</returns>
+ /// <exception cref="NotSupportedException">Thrown when Nfc is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public NfcTag GetConnectedTag()
{
IntPtr tagHandle = IntPtr.Zero;