From 9181a11efdd871e8b7ef9095a2d0b922eb14af06 Mon Sep 17 00:00:00 2001 From: Jihoon Jung Date: Tue, 4 Aug 2015 11:10:50 +0900 Subject: [PATCH] remove nfc blacklist api - nfc_p2p_connection_handover - nfc_p2p_is_supported_ac_type - nfc_p2p_send_no_permission Signed-off-by: Ji-hoon Jung Change-Id: I5c19e9ca97a3de2bf297ab1b78c00fde20287e57 --- .../html/native/network/nfc_tutorial_n.htm | 39 ++-------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/org.tizen.tutorials/html/native/network/nfc_tutorial_n.htm b/org.tizen.tutorials/html/native/network/nfc_tutorial_n.htm index 7e60eaf..034c18c 100644 --- a/org.tizen.tutorials/html/native/network/nfc_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/network/nfc_tutorial_n.htm @@ -435,41 +435,6 @@ if (NFC_ERROR_NONE != error_code) // Error occurred

After reading the message from the remote device, check its number of records using the nfc_ndef_message_get_record_count() function and get more detailed info about the message by calling the nfc_ndef_message_read_cb() function described earlier.

-

While having some other device connected through NFC, hand over the connection to some alternative carrier (AC), such as Bluetooth, Wi-Fi, or Wi-Fi Direct™.

- -

Firstly, call the nfc_p2p_is_supported_ac_type() function to find out which alternative carriers are supported by the device.

-
nfc_ac_type_e ac = NFC_AC_TYPE_BT;
-
-while(NFC_AC_TYPE_UNKNOWN != ac)
-{
-   if (nfc_p2p_is_supported_ac_type(ac)) break;
-   ac++;
-}
- -

Iterate through the known AC types and break the iteration after finding the first one that is supported. The supported AC type is stored in the ac variable.

-

Now, make the connection handover by calling the nfc_p2p_connection_handover() function.

-
if (NFC_AC_TYPE_UNKNOWN != ac)
-   nfc_p2p_connection_handover(target, ac, on_nfc_p2p_connection_handover_completed, NULL);
-

The parameters are:

- - -

The on_nfc_p2p_connection_handover_completed() callback in this tutorial only prints the alternative carrier data if no error occurs during the handover.

-
static void on_nfc_p2p_connection_handover_completed(int error_code, nfc_ac_type_e carrier, void * ac_data, int ac_data_size, void *user_data)
-{
-   if (!found_error(NFC_ERROR_NONE, "on_nfc_p2p_connection_handover_completed", error_code))
-   {
-      char *_data = (char *) malloc(sizeof(char) * (ac_data_size + 1));
-      strncpy(_data, (char *)ac_data, ac_data_size);
-      _data[ac_data_size] = '\0';
-      dlog_print(DLOG_INFO, LOG_TAG, "AC: %s", _data);
-      free(_data);
-   }
-}
-

Working with NFC Secure Element

The secure element event notification is received through the on_nfc_se_event() function. The first parameter defines the event type. The second one is user data - in this case it is not used. Depending on the event type, you can take some additional actions.

@@ -950,7 +915,7 @@ nfc_ndef_message_append_record(ndef_message, ndef_email_record);
  • Send a message to another device. -

    When another P2P device is attached, send the prepared message to it. You can use the nfc_p2p_send() or nfc_p2p_send_no_permission() function if you do not want to check permissions. Provide a target handle and a sent message handle. You can also set a callback called when the sending is completed.

    +

    When another P2P device is attached, send the prepared message to it. You can use the nfc_p2p_send() function if you do not want to check permissions. Provide a target handle and a sent message handle. You can also set a callback called when the sending is completed.

    nfc_p2p_send(target, ndef_message, NULL, NULL);
  • Receive a message from another device. @@ -999,4 +964,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + -- 2.7.4