result, &dev_address,
event_info->cb, event_info->user_data);
- if (result != BLUETOOTH_ERROR_NONE) {
+ if (result != BLUETOOTH_ERROR_NONE)
__bt_remove_push_request_id(request_id);
- }
} else if (strcasecmp(signal_name, BT_MAP_DISCONNECTED) == 0) {
const char *address = NULL;
int request_id = 0;
request_id, &fields_info,
event_info->cb, event_info->user_data);
- while(--i >= 0) {
+ while (--i >= 0) {
free(fields_info.fields[i]);
fields_info.fields[i] = NULL;
}
#include "bt-dpm.h"
#endif
-GVariant *__g_variant_new_array_split(char *str) {
+GVariant *__g_variant_new_array_split(char *str)
+{
GVariantBuilder b;
g_variant_builder_init(&b, (const GVariantType*) "a{s}");
char *pos = str;
char *item;
- while ((item = strsep(&pos, ","))) {
+
+ while ((item = strsep(&pos, ",")))
g_variant_builder_add(&b, "{s}", item);
- }
+
return g_variant_builder_end(&b);
}
return result;
}
-BT_EXPORT_API int bluetooth_map_client_list_filter_fields(
- bt_map_client_session_info_s *session)
+BT_EXPORT_API int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session)
{
BT_DBG("bluetooth_map_client_list_filter_fields");
int result = BLUETOOTH_ERROR_NONE;
return result;
}
-BT_EXPORT_API int bluetooth_map_client_list_messages(
- bt_map_client_session_info_s *session,
- const char *folder,
- bt_map_client_list_messages_filter_t *filter)
+BT_EXPORT_API int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
+ const char *folder,
+ bt_map_client_list_messages_filter_t *filter)
{
BT_DBG("bluetooth_map_client_list_messages");
int result = 0;
return result;
}
-BT_EXPORT_API int bluetooth_map_client_update_inbox(
- bt_map_client_session_info_s *session)
+BT_EXPORT_API int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session)
{
BT_DBG("bluetooth_map_client_update_inbox");
int result = BLUETOOTH_ERROR_INTERNAL;
return result;
}
-BT_EXPORT_API int bluetooth_map_client_push_message(
- bt_map_client_session_info_s *session,
- const char *source_file,
- const char *folder,
- bt_map_client_push_message_args_t *args)
+BT_EXPORT_API int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
+ const char *source_file,
+ const char *folder,
+ bt_map_client_push_message_args_t *args)
{
BT_DBG("Entered bluetooth_map_client_push_message");
int result = 0;
return result;
}
-BT_EXPORT_API int bluetooth_map_client_get_message(
- bt_map_client_session_info_s *session,
- const bt_map_client_message_object_t message_object,
- const char *target_file,
- bool attachment)
+BT_EXPORT_API int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
+ const bt_map_client_message_object_t message_object,
+ const char *target_file,
+ bool attachment)
{
- BT_DBG("Entered bluetooth_map_client_get_message");
+ BT_DBG("Entered bluetooth_map_client_get_message");
int result = 0;
BT_CHECK_ENABLED(return);
char *address = (char *)g_variant_get_data(in_param1);
char *session_id = NULL;
result = _bt_create_session_sync(address, &session_id);
- if (result == BLUETOOTH_ERROR_NONE) {
+ if (result == BLUETOOTH_ERROR_NONE)
g_array_append_vals(*out_param1, session_id, strlen(session_id)+1);
- }
break;
}
BT_DBG("BT_MAP_DESTROY_SESSION");
char* session_id = (char *)g_variant_get_data(in_param1);
result = _bt_destroy_session_sync(session_id);
- if (result == BLUETOOTH_ERROR_NONE) {
+ if (result == BLUETOOTH_ERROR_NONE)
BT_DBG("successfully destroyed session");
- }
break;
}
char* filter_serialized = (char*)g_variant_get_data(in_param2);
result = _bt_map_client_list_folders(request_id, context, session_id, filter_serialized);
- if (result == BLUETOOTH_ERROR_NONE) {
+ if (result == BLUETOOTH_ERROR_NONE)
BT_DBG("_bt_map_client_list_folders succeed");
- }
+
break;
}
char* session_id = (char *)g_variant_get_data(in_param1);
result = _bt_map_client_list_filter_fields(request_id, context, session_id);
- if (result == BLUETOOTH_ERROR_NONE) {
+ if (result == BLUETOOTH_ERROR_NONE)
BT_DBG("_bt_map_client_list_filter_fields succeed");
- }
+
break;
}
char* filter_serialized = (char*)g_variant_get_data(in_param3);
result = _bt_map_client_list_messages(request_id, context, session_id, folder, filter_serialized);
- if (result == BLUETOOTH_ERROR_NONE) {
+ if (result == BLUETOOTH_ERROR_NONE)
BT_DBG("_bt_map_client_list_messages succeed");
- } else {
+ else
BT_DBG("_bt_map_client_list_messages failed");
- }
+
break;
}
result = _bt_map_client_push_message(
request_id, context, session_id, source_file, folder, args_serialized);
- if (result == BLUETOOTH_ERROR_NONE) {
+ if (result == BLUETOOTH_ERROR_NONE)
BT_DBG("_bt_map_client_push_message succeed");
- } else {
+ else
BT_ERR("_bt_map_client_push_message failed");
- }
+
break;
}
result = _bt_map_client_get_message(request_id, context, message_object,
target_file, attachment);
- if (result == BLUETOOTH_ERROR_NONE) {
+ if (result == BLUETOOTH_ERROR_NONE)
BT_DBG("_bt_map_client_get_message succeed");
- }
break;
}
case BT_PXP_REPORTER_REGISTER:
case BT_PXP_REPORTER_UNREGISTER:
case BT_PXP_REPORTER_GET_PROPERTY:
+
ret_val = cynara_check(p_cynara, client_creds, client_session, user_creds,
BT_PRIVILEGE_PLATFORM);
}
retv_if(session_proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
- GVariantBuilder* builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
+ GVariantBuilder* builder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY);
g_variant_builder_add(builder, "{sv}", "Target",
g_variant_new("s", "map"));
GVariant *args = g_variant_builder_end(builder);
- g_variant_builder_unref (builder);
+ g_variant_builder_unref(builder);
GVariant *param = g_variant_new("(s@a{sv})", address, args);
char* string = g_variant_print (param, true);
return BLUETOOTH_ERROR_NONE;
}
-void _bt_map_on_transfer_finished(const char* transfer_object_path, const int error) {
+void _bt_map_on_transfer_finished(const char *transfer_object_path, const int error)
+{
BT_DBG("Entered _bt_map_on_transfer_finished");
BT_DBG("Looking for transfer %s id", transfer_object_path);
GSList* transfer = NULL;
for (transfer = transfer_list; transfer != NULL; transfer = g_slist_next(transfer)) {
callback_data = transfer->data;
- if (NULL == callback_data) {
+ if (NULL == callback_data)
continue;
- }
if (0 == strcmp(transfer_object_path, callback_data->transfer_path)) {
BT_DBG("request id FOUND - triggering event");
int event = -1;
switch (callback_data->transfer_type) {
- case BT_MAP_TRANSFER_GET_MESSAGE:
- event = BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE;
- break;
- case BT_MAP_TRANSFER_PUSH_MESSAGE:
- event = BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE;
- break;
+ case BT_MAP_TRANSFER_GET_MESSAGE:
+ event = BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE;
+ break;
+ case BT_MAP_TRANSFER_PUSH_MESSAGE:
+ event = BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE;
+ break;
}
_bt_send_event(BT_MAP_CLIENT_EVENT, event, param);
* BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
* BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
*
- * @exception None
+ * @exception None
*
- * @remark None
- * @see bluetooth_map_client_deinit
+ * @remark None
+ * @see bluetooth_map_client_deinit
*/
int bluetooth_map_client_init(void);
int bluetooth_map_client_deinit(void);
-int bluetooth_map_client_create_session(
- bt_map_client_session_info_s *session
-);
+int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
-int bluetooth_map_client_destroy_session(
- bt_map_client_session_info_s *session
-);
+int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
-int bluetooth_map_client_set_folder(
- bt_map_client_session_info_s *session,
- const char *name
-);
+int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
-int bluetooth_map_client_list_folders(
- bt_map_client_session_info_s *session,
- bt_map_client_list_folders_filter_t *filter
-);
+int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
+ bt_map_client_list_folders_filter_t *filter);
/**
* @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
* @param[in] session Information about session.
* @remark None
*/
-int bluetooth_map_client_list_filter_fields(
- bt_map_client_session_info_s *session
-);
-
-int bluetooth_map_client_list_messages(
- bt_map_client_session_info_s *session,
- const char *folder,
- bt_map_client_list_messages_filter_t *filter
-);
-
-int bluetooth_map_client_update_inbox(
- bt_map_client_session_info_s *session
-);
-
-int bluetooth_map_client_push_message(
- bt_map_client_session_info_s *session,
- const char *source_file,
- const char *folder,
- bt_map_client_push_message_args_t *args
-);
-
-int bluetooth_map_client_get_message(
- bt_map_client_session_info_s *session,
- const bt_map_client_message_object_t message_object,
- const char *target_file,
- bool attachment
-);
+int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
+
+int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
+ const char *folder,
+ bt_map_client_list_messages_filter_t *filter);
+
+int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
+
+int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
+ const char *source_file,
+ const char *folder,
+ bt_map_client_push_message_args_t *args);
+
+int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
+ const bt_map_client_message_object_t message_object,
+ const char *target_file,
+ bool attachment);
/**