Change-Id: I12eccc5b3f2bda2e39d9bf5f45c70aa2d6f309c4
GVariantIter *properites = NULL;
int i = 0;
while (g_variant_iter_loop(iter, "{oa{sv}}", &object, &properites)) {
GVariantIter *properites = NULL;
int i = 0;
while (g_variant_iter_loop(iter, "{oa{sv}}", &object, &properites)) {
- messages_struct.message_items[i].message_object_name = strdup(object);
- BT_DBG("Message found: %s", messages_struct.message_items[i].message_object_name);
+ messages_struct.message_items[i].message_object = strdup(object);
+ BT_DBG("Message found: %s", messages_struct.message_items[i].message_object);
messages_struct.message_items[i].folder = NULL;
messages_struct.message_items[i].subject = NULL;
messages_struct.message_items[i].timestamp = NULL;
messages_struct.message_items[i].folder = NULL;
messages_struct.message_items[i].subject = NULL;
messages_struct.message_items[i].timestamp = NULL;
BT_EXPORT_API int bluetooth_map_client_get_message(
bt_map_client_session_info_s *session,
BT_EXPORT_API int bluetooth_map_client_get_message(
bt_map_client_session_info_s *session,
- const char *message_object_name,
+ const bt_map_client_message_object_t message_object,
const char *target_file,
bool attachment)
{
const char *target_file,
bool attachment)
{
BT_CHECK_ENABLED(return);
BT_CHECK_PARAMETER(session, return);
BT_CHECK_PARAMETER(session->session_path, return);
BT_CHECK_ENABLED(return);
BT_CHECK_PARAMETER(session, return);
BT_CHECK_PARAMETER(session->session_path, return);
- BT_CHECK_PARAMETER(message_object_name, return);
+ BT_CHECK_PARAMETER(message_object, return);
BT_CHECK_PARAMETER(target_file, return);
bt_user_info_t *user_info = _bt_get_user_data(BT_COMMON);
BT_CHECK_PARAMETER(target_file, return);
bt_user_info_t *user_info = _bt_get_user_data(BT_COMMON);
// TODO session currently is not used, but should be valid
//g_array_append_vals(in_param1, session->session_path, strlen(session->session_path)+1);
// TODO session currently is not used, but should be valid
//g_array_append_vals(in_param1, session->session_path, strlen(session->session_path)+1);
- g_array_append_vals(in_param2, message_object_name, strlen(message_object_name)+1);
+ g_array_append_vals(in_param2, message_object, strlen(message_object)+1);
g_array_append_vals(in_param3, target_file, strlen(target_file)+1);
g_array_append_vals(in_param4, &attachment, sizeof(attachment));
g_array_append_vals(in_param3, target_file, strlen(target_file)+1);
g_array_append_vals(in_param4, &attachment, sizeof(attachment));
BT_DBG("BT_MAP_GET_MESSAGE");
// TODO session currently is not used, but should be valid
//char* session_id = (char *)g_variant_get_data(in_param1);
BT_DBG("BT_MAP_GET_MESSAGE");
// TODO session currently is not used, but should be valid
//char* session_id = (char *)g_variant_get_data(in_param1);
- char* message_object_name = (char *)g_variant_get_data(in_param2);
+ char* message_object = (char *)g_variant_get_data(in_param2);
char* target_file = (char *)g_variant_get_data(in_param3);
bool attachment = false;
__bt_service_get_parameters(in_param4, &attachment, sizeof(bool));
char* target_file = (char *)g_variant_get_data(in_param3);
bool attachment = false;
__bt_service_get_parameters(in_param4, &attachment, sizeof(bool));
- result = _bt_map_client_get_message(request_id, context, message_object_name,
+ result = _bt_map_client_get_message(request_id, context, message_object,
target_file, attachment);
if (result == BLUETOOTH_ERROR_NONE) {
BT_DBG("_bt_map_client_get_message succeed");
target_file, attachment);
if (result == BLUETOOTH_ERROR_NONE) {
BT_DBG("_bt_map_client_get_message succeed");
int _bt_map_client_get_message(
int request_id,
GDBusMethodInvocation *context,
int _bt_map_client_get_message(
int request_id,
GDBusMethodInvocation *context,
- const char* message_object_name,
+ const char* message_object,
const char* target_file,
bool attachment)
{
const char* target_file,
bool attachment)
{
GError *error = NULL;
int result = BLUETOOTH_ERROR_NONE;
GError *error = NULL;
int result = BLUETOOTH_ERROR_NONE;
- retv_if(message_object_name == NULL, BLUETOOTH_ERROR_INVALID_PARAM);
+ retv_if(message_object == NULL, BLUETOOTH_ERROR_INVALID_PARAM);
// TODO event listeners registration on first call, where should it be unregistered??
_bt_map_client_event_init();
// TODO event listeners registration on first call, where should it be unregistered??
_bt_map_client_event_init();
// create message proxy
g_clear_error(&error);
message_proxy = g_dbus_proxy_new_sync(g_conn, G_DBUS_PROXY_FLAGS_NONE, NULL,
// create message proxy
g_clear_error(&error);
message_proxy = g_dbus_proxy_new_sync(g_conn, G_DBUS_PROXY_FLAGS_NONE, NULL,
- BT_OBEX_SERVICE_NAME, message_object_name, "org.bluez.obex.Message1",
+ BT_OBEX_SERVICE_NAME, message_object, "org.bluez.obex.Message1",
NULL, &error);
if (error != NULL) {
BT_ERR("Could not create message proxy: %s\n", error->message);
NULL, &error);
if (error != NULL) {
BT_ERR("Could not create message proxy: %s\n", error->message);
int _bt_map_client_get_message(
int request_id,
GDBusMethodInvocation *context,
int _bt_map_client_get_message(
int request_id,
GDBusMethodInvocation *context,
- const char* message_object_name,
+ const char* message_object,
const char* target_file,
bool attachment);
const char* target_file,
bool attachment);
char* remote_address;
} bt_map_client_session_info_s;
char* remote_address;
} bt_map_client_session_info_s;
+typedef char* bt_map_client_message_object_t;
+
typedef struct {
int16_t offset;
int16_t max_count;
typedef struct {
int16_t offset;
int16_t max_count;
} bt_map_client_list_messages_filter_t;
typedef struct {
} bt_map_client_list_messages_filter_t;
typedef struct {
- char *message_object_name;
+ bt_map_client_message_object_t message_object;
char *folder;
char *subject;
char *timestamp;
char *folder;
char *subject;
char *timestamp;
int bluetooth_map_client_get_message(
bt_map_client_session_info_s *session,
int bluetooth_map_client_get_message(
bt_map_client_session_info_s *session,
- const char *message_object_name,
+ const bt_map_client_message_object_t message_object,
const char *target_file,
bool attachment
);
const char *target_file,
bool attachment
);