[bluetooth-frwk] setFolder
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-map-client.c
index fcd033c..6c6b3de 100644 (file)
@@ -98,7 +98,35 @@ BT_EXPORT_API int bluetooth_map_destroy_session(bt_map_session_info_s* session)
        return result;
 }
 
+BT_EXPORT_API int bluetooth_map_set_folder(
+       bt_map_session_info_s* session,
+       const char* name)
+{
+       BT_DBG("bluetooth_map_set_folder");
+       int result;
+
+       BT_CHECK_ENABLED(return);
+       BT_CHECK_PARAMETER(session->session_path, return);
+       BT_CHECK_PARAMETER(name, return);
 
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, session->session_path, strlen(session->session_path) + 1);
+       g_array_append_vals(in_param2, name, strlen(name) + 1);
+
+       result = _bt_send_request(BT_OBEX_SERVICE, BT_MAP_SET_FOLDER,
+               in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       if (result != BLUETOOTH_ERROR_NONE) {
+               BT_ERR("bluetooth_map_set_folder failed");
+               return BLUETOOTH_ERROR_INTERNAL;
+       }
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       return result;
+}
 
 BT_EXPORT_API int bluetooth_map_update_inbox(bt_map_session_info_s* session)
 {