tc_table_t tc_table[] = {
/* manage api*/
{"NFC Initialize Test", 1},
- {"NFC Configure discovery (CE only) Test", 2},
- {"NFC Configure discovery (Tag only) Test", 3},
- {"NFC Tag NDEF Read", 4},
- {"NFC Test Mode ON", 5},
- {"NFC Test Mode OFF", 6},
- {"NFC Deinitialize Test", 7},
- {"NFC Configure discovery (ALL enable) Test", 8},
- {"NFC Configure discovery (ALL disable) Test", 9},
+ {"NFC Enable Test", 2},
+ {"NFC Disable Test", 3},
+ {"NFC Configure discovery (CE only) Test", 4},
+ {"NFC Configure discovery (Tag only) Test", 5},
+ {"NFC Tag NDEF Read", 6},
+ {"NFC Tag NDEF Write", 7},
+ {"NFC Test Mode ON", 8},
+ {"NFC Test Mode OFF", 9},
+ {"NFC Deinitialize Test", 10},
+ {"NFC Configure discovery (ALL enable) Test", 11},
+ {"NFC Configure discovery (ALL disable) Test", 12},
/* -----------*/
{"Finish", 0x00ff},
return msg;
}
+void _nfc_activation_completed_cb(nfc_error_e error, void *user_data)
+{
+ if (error == NFC_ERROR_NONE)
+ TC_PRT("Set Activation Successful");
+ else
+ TC_PRT("Set Activation Failed. Result : %d", error);
+}
+
int test_input_callback(void *data)
{
int ret = 0;
break;
case 2:
{
+ TC_PRT("nfc enable start");
+ ret = nfc_manager_set_activation(true, _nfc_activation_completed_cb, NULL);
+ TC_PRT("nfc_manager_set_activation end : %d", ret);
+ }
+ break;
+ case 3:
+ {
+ TC_PRT("nfc disable start");
+ ret = nfc_manager_set_activation(false, _nfc_activation_completed_cb, NULL);
+ TC_PRT("nfc_manager_set_activation end : %d", ret);
+ }
+ break;
+ case 4:
+ {
TC_PRT("nfc configure discovery : CE only start");
ret = nfc_manager_configure_discovery(NFC_DISCOVERY_MODE_CONFIG_LISTENING);
TC_PRT("nfc configure discovery : CE only end : %d", ret);
}
break;
- case 3:
+ case 5:
{
TC_PRT("nfc configure discovery : Tag only start");
ret = nfc_manager_configure_discovery(NFC_DISCOVERY_MODE_CONFIG_POLLING);
TC_PRT("nfc configure discovery : Tag only end : %d", ret);
}
break;
- case 4:
+ case 6:
{
TC_PRT("Tag read start");
nfc_tag_h current_tag = NULL;
TC_PRT("Tag read end");
}
break;
- case 5:
+ case 7:
+ {
+ TC_PRT("Tag write start");
+
+ nfc_tag_h current_tag = NULL;
+ nfc_manager_get_connected_tag(¤t_tag);
+ nfc_ndef_message_h msg = __create_ndef_message();
+
+ if (msg != NULL)
+ {
+ if (current_tag != NULL)
+ ret = nfc_tag_write_ndef(current_tag, msg, __tag_write_completed, NULL);
+ else
+ TC_PRT("Tag Not Connected.");
+ }
+ else
+ {
+ TC_PRT("NDEF Message create is failed.");
+ }
+
+ TC_PRT("Tag write end");
+ }
+ break;
+ case 8:
{
TC_PRT("Test Mode ON");
nfc_manager_test_mode_on();
}
break;
- case 6:
+ case 9:
{
TC_PRT("Test Mode OFF");
nfc_manager_test_mode_off();
}
break;
- case 7:
+ case 10:
{
TC_PRT("nfc deinitialize start");
TC_PRT("nfc deinitialize end");
}
break;
- case 8:
+ case 11:
{
TC_PRT("nfc configure discovery : All enable start");
ret = nfc_manager_configure_discovery(NFC_DISCOVERY_MODE_RESUME);
TC_PRT("nfc configure discovery : All enable end : %d", ret);
}
break;
- case 9:
+ case 12:
{
TC_PRT("nfc configure discovery : All disable start");
ret = nfc_manager_configure_discovery(NFC_DISCOVERY_MODE_STOP);