debugging notification API
authorYoungjae Shin <yj99.shin@samsung.com>
Tue, 4 Feb 2020 05:54:52 +0000 (14:54 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Wed, 18 Mar 2020 08:53:50 +0000 (17:53 +0900)
client/mdsc_noti_mode.c
include/modes.h
unittest/modes_test_noti.cpp

index 9b24f7a0b0ecb870c0b274150dc30e061b3f9aad..62fadd3bfc9d7283d16d290e3c962fc3ce6aeaa1 100644 (file)
@@ -52,7 +52,7 @@ API int modes_subscribe_mode_changes(modes_h handle, modes_noti_fn cb, void *use
        return MODES_ERROR_NONE;
 }
 
-//TODO: modes_noti_disconnect(ModesNotiFunc cb, void *user_data)
+//TODO: multi callbacks
 API void modes_unsubscribe_mode_changes(modes_h handle)
 {
        RET_IF(0 == mdsc_noti_signal_ID);
@@ -60,6 +60,7 @@ API void modes_unsubscribe_mode_changes(modes_h handle)
        RET_IF(NULL == handle->conn);
 
        g_signal_handler_disconnect(handle->conn, mdsc_noti_signal_ID);
+       mdsc_noti_signal_ID = 0;
        mdsc_noti_data.cb = NULL;
        mdsc_noti_data.user_data = NULL;
 }
index 606ceefdca2a3015363a55d9ad41c76bef6f635c..24fb5b8670dab1684328288fd035d5cda558af5f 100644 (file)
@@ -247,7 +247,7 @@ int modes_subscribe_mode_changes(modes_h handle, modes_noti_fn cb, void *user_da
  *
  * @see modes_subscribe_mode_changes()
  */
-void modes_unsubscribe_mode_changes();
+void modes_unsubscribe_mode_changes(modes_h handle);
 
 //TODO:it must be opaque type
 typedef struct {
index a051b004d8059812783af9e60af269bce72539d7..97d27d64f3be8d6f7087e443118b0ee4fc15d78e 100644 (file)
@@ -79,5 +79,5 @@ TEST_F(ClientNotiTest, notiConnect)
 
        g_main_loop_run(loop);
 
-       modes_unsubscribe_mode_changes();
+       modes_unsubscribe_mode_changes(handle);
 }