nfc_manager_set_activation_changed_cb() API Guide 요청

nfc_manager_set_activation_changed_cb() API Guide 요청

BY 19 Nov 2015 Native Application Development

 

nfc_manager_set_activation_changed_cb() 이

설정의 NFC 설정을 변경하면 callback 이 오는 함수로 보이는데

callback 이 오질 않네요… 제가 잘못 사용을 한건지…

관련 코드는 아래와 같습니다. help 보고….

환경은 Gear S2(sdk 2.3.1) 에서 확인 했습니다.

코드가 잘못된건지 API 지원을 하지 않는건지 

아시는 분 계시면 답변 부탁드립니다.

특히, g_timeout_add 와 g_main_loop_run 은 왜 하는지 모르겠네요. 꼭 해야하는지…

static gboolean timeout_func_main(gpointer user_data)
{
    DLOG_DEBUG("[callback] timeout_func_main()");

	return FALSE;
}

static void on_nfc_activation_changed(bool activated, void *user_data)
{
   if (activated)
      DLOG_INFO("[callback] NFC activated");
   else
      DLOG_INFO("[callback] NFC deactivated");
}

...

void app_control(app_control_h service, void *user_data)
{
...
    int error_code = NFC_ERROR_NONE;

	error_code = nfc_manager_initialize();
	if (NFC_ERROR_NONE != error_code) // Error occurred
	{
		g_timeout_add(1000, timeout_func_main, NULL);
		g_main_loop_run(NULL);
	}

	nfc_manager_set_activation_changed_cb(on_nfc_activation_changed, NULL);
...
}

 

Written by