[bluetooth] updateInbox 58/102858/2
authorLukasz Bardeli <l.bardeli@samsung.com>
Tue, 25 Oct 2016 10:48:51 +0000 (12:48 +0200)
committerPyun DoHyun <dh79.pyun@samsung.com>
Thu, 8 Dec 2016 00:11:34 +0000 (16:11 -0800)
Change-Id: I37346188c6c0a0a4602ad7e30445b0f165eb227a
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
include/mobile/bluetooth_internal.h
include/wearable/bluetooth_internal.h
src/bluetooth-map-client.c

index 68ae39a87805734219ecad9214b065542ca3dfa2..daef288055498478f88c728dcd50996473f52f16 100644 (file)
@@ -1562,6 +1562,21 @@ int bt_map_client_deinitialize(void);
 int bt_map_client_create_session(const char* remote_address, bt_map_session_info_h* session);
 int bt_map_client_destroy_session(bt_map_session_info_h session);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_MAP_CLIENT_MODULE
+ * @brief Request remote to update its inbox.
+ * @since_tizen 3.0
+ * @param[in] handle Session handle
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
+ *
+ * @see  bt_map_client_update_inbox()
+ */
+int bt_map_client_update_inbox(bt_map_session_info_h handle);
+
 /* TODO: MAP CAPI functions, see above */
 
 /**
index 02dc2bbc8ce388d3d49e24b9fc3cb95387546967..20929cc6fcb63ee7eaf1f99d773f4988980e20f5 100644 (file)
@@ -1532,6 +1532,21 @@ int bt_map_client_deinitialize(void);
 int bt_map_client_create_session(const char* remote_address, bt_map_session_info_h* session);
 int bt_map_client_destroy_session(bt_map_session_info_h session);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_MAP_CLIENT_MODULE
+ * @brief Request remote to update its inbox.
+ * @since_tizen 3.0
+ * @param[in] handle Session handle
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
+ *
+ * @see  bt_map_client_update_inbox()
+ */
+int bt_map_client_update_inbox(bt_map_session_info_h handle);
+
 /* TODO: MAP CAPI functions, see above */
 
 /**
index 03e1c66a7532f284d0f15ff46fbf9c147e111eb1..1aad5b4780ad7d0dad1be4c32c225f59cc5c5704 100644 (file)
@@ -66,13 +66,14 @@ int bt_map_client_initialize(void)
        }
 
        is_map_client_initialized = true;
-       return BT_ERROR_NONE;
+       return error_code;
 }
 
 int bt_map_client_deinitialize(void)
 {
        int error_code = BT_ERROR_NONE;
 
+       //TODO it is not supported on TM1
        //BT_CHECK_MAP_CLIENT_SUPPORT();
        BT_CHECK_INIT_STATUS();
        BT_CHECK_MAP_CLIENT_INIT_STATUS();
@@ -86,7 +87,7 @@ int bt_map_client_deinitialize(void)
        }
 
        is_map_client_initialized = false;
-       return BT_ERROR_NONE;
+       return error_code;
 }
 
 
@@ -145,10 +146,23 @@ int bt_map_client_set_folder(const char *name)
        return BT_ERROR_NONE;
 }
 
-int bt_map_client_update_inbox(void)
+int bt_map_client_update_inbox(bt_map_session_info_h handle)
 {
-       /* TODO: MAP */
-       return BT_ERROR_NONE;
+       int error_code = BT_ERROR_NONE;
+
+       //BT_CHECK_MAP_CLIENT_SUPPORT();
+       BT_CHECK_INIT_STATUS();
+       BT_CHECK_MAP_CLIENT_INIT_STATUS();
+
+       bt_map_session_info_s* session = (bt_map_session_info_s*)handle;
+
+       error_code = _bt_get_error_code(bluetooth_map_update_inbox(session));
+
+       if (error_code != BT_ERROR_NONE) {
+               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code),
+                               error_code);
+       }
+       return error_code;
 }
 
 int bt_map_client_list_folders(