Change-Id: Ia82e50427bd0ec90323e1de99a55973307526905
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
tmp_value = g_variant_lookup_value(reply, "Class", G_VARIANT_TYPE_UINT32);
g_variant_get(tmp_value, "u", &device_class);
tmp_value = g_variant_lookup_value(reply, "Class", G_VARIANT_TYPE_UINT32);
g_variant_get(tmp_value, "u", &device_class);
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
- tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Address", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
- tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Address", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
- tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Address", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
- tmp_value = g_variant_lookup_value (reply, "Name", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Name", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &name);
G_VARIANT_UNREF(tmp_value);
if (!name)
g_variant_get(tmp_value, "s", &name);
G_VARIANT_UNREF(tmp_value);
if (!name)
- g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
+ g_variant_get(reply_temp, "(@a{sv})", &reply); /* Format of reply a{sv}*/
- tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(reply, "Address", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
g_variant_get(tmp_value, "s", &address);
G_VARIANT_UNREF(tmp_value);
if (!address) {
bundle_add(b, "event-type", "unable-to-pairing");
bundle_add(b, "event-type", "unable-to-pairing");
- if (result == BLUETOOTH_ERROR_TIMEOUT )
+ if (result == BLUETOOTH_ERROR_TIMEOUT)
bundle_add(b, "error", "timeout");
else if (result == BLUETOOTH_ERROR_AUTHENTICATION_FAILED)
bundle_add(b, "error", "authfailed");
bundle_add(b, "error", "timeout");
else if (result == BLUETOOTH_ERROR_AUTHENTICATION_FAILED)
bundle_add(b, "error", "authfailed");
g_variant_get(result , "(@a{sv})", &value);
g_variant_unref(result);
g_variant_get(result , "(@a{sv})", &value);
g_variant_unref(result);
- tmp_value = g_variant_lookup_value (value, "Alias", G_VARIANT_TYPE_STRING);
+ tmp_value = g_variant_lookup_value(value, "Alias", G_VARIANT_TYPE_STRING);
g_variant_get(tmp_value, "s", &name);
g_variant_unref(tmp_value);
g_variant_get(tmp_value, "s", &name);
g_variant_unref(tmp_value);
dev_info->paired = tmp_value ? g_variant_get_boolean(tmp_value) : FALSE;
g_variant_unref(tmp_value);
dev_info->paired = tmp_value ? g_variant_get_boolean(tmp_value) : FALSE;
g_variant_unref(tmp_value);
- BT_DBG("Paired %d", dev_info->paired );
+ BT_DBG("Paired %d", dev_info->paired);
tmp_value = g_variant_lookup_value(value, "RSSI", G_VARIANT_TYPE_INT32);
dev_info->rssi = tmp_value ? g_variant_get_int32(tmp_value) : 0;
tmp_value = g_variant_lookup_value(value, "RSSI", G_VARIANT_TYPE_INT32);
dev_info->rssi = tmp_value ? g_variant_get_int32(tmp_value) : 0;
int ret = BLUETOOTH_ERROR_NONE;
ret = _bt_agent_reply_cancellation();
int ret = BLUETOOTH_ERROR_NONE;
ret = _bt_agent_reply_cancellation();
- if (ret != BLUETOOTH_ERROR_NONE){
+ if (ret != BLUETOOTH_ERROR_NONE) {
BT_ERR("Fail to call reply cancellation");
return ret;
}
BT_ERR("Fail to call reply cancellation");
return ret;
}
GVariantBuilder *builder = NULL;
int i = 0;
builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
GVariantBuilder *builder = NULL;
int i = 0;
builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
- for (i=0; i < remote_dev_info->uuid_count; i++) {
+ for (i = 0; i < remote_dev_info->uuid_count; i++) {
g_variant_builder_add(builder, "s",
remote_dev_info->uuids[i]);
}
g_variant_builder_add(builder, "s",
remote_dev_info->uuids[i]);
}
retv_if(bonding_info == NULL, BLUETOOTH_ERROR_NOT_IN_OPERATION);
ret = _bt_agent_reply_cancellation();
retv_if(bonding_info == NULL, BLUETOOTH_ERROR_NOT_IN_OPERATION);
ret = _bt_agent_reply_cancellation();
- if (ret != BLUETOOTH_ERROR_NONE){
+ if (ret != BLUETOOTH_ERROR_NONE) {
BT_ERR("Fail to call reply cancellation");
return ret;
}
BT_ERR("Fail to call reply cancellation");
return ret;
}
event:
builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
event:
builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
- for (i=0; i < remote_dev_info->uuid_count; i++) {
+ for (i = 0; i < remote_dev_info->uuid_count; i++) {
g_variant_builder_add(builder, "s",
remote_dev_info->uuids[i]);
}
g_variant_builder_add(builder, "s",
remote_dev_info->uuids[i]);
}
retv_if(device_proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
result = g_dbus_proxy_call_sync(device_proxy, "Get",
retv_if(device_proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
result = g_dbus_proxy_call_sync(device_proxy, "Get",
- g_variant_new("(ss)", BT_DEVICE_INTERFACE, "Trusted" ),
+ g_variant_new("(ss)", BT_DEVICE_INTERFACE, "Trusted"),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
}
g_dbus_proxy_call_sync(device_proxy, "Set",
}
g_dbus_proxy_call_sync(device_proxy, "Set",
- g_variant_new("(ssv)", BT_DEVICE_INTERFACE, "Trusted", g_variant_new("b",authorize)),
+ g_variant_new("(ssv)", BT_DEVICE_INTERFACE, "Trusted", g_variant_new("b", authorize)),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
g_variant_get(result , "(@a{sv})", &value);
g_variant_unref(result);
g_variant_get(result , "(@a{sv})", &value);
g_variant_unref(result);
- tmp_value = g_variant_lookup_value (value, "GattConnected", G_VARIANT_TYPE_BOOLEAN);
+ tmp_value = g_variant_lookup_value(value, "GattConnected", G_VARIANT_TYPE_BOOLEAN);
if (tmp_value == NULL) {
g_object_unref(device_proxy);
return BLUETOOTH_ERROR_INTERNAL;
}
if (tmp_value == NULL) {
g_object_unref(device_proxy);
return BLUETOOTH_ERROR_INTERNAL;
}
- *is_connected = g_variant_get_boolean (tmp_value);
+ *is_connected = g_variant_get_boolean(tmp_value);
BT_DBG("gatt is connected : %d", *is_connected);
g_variant_unref(tmp_value);
BT_DBG("gatt is connected : %d", *is_connected);
g_variant_unref(tmp_value);
_bt_convert_addr_type_to_string(address, device_address->addr);
_bt_convert_addr_type_to_string(address, device_address->addr);
- if(connection_type == BLUETOOTH_NAP_SERVER_SERVICE) {
+ if (connection_type == BLUETOOTH_NAP_SERVER_SERVICE) {
object_path = _bt_get_adapter_path();
device_proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
NULL, BT_BLUEZ_NAME,
object_path = _bt_get_adapter_path();
device_proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
NULL, BT_BLUEZ_NAME,
}
g_variant_unref(value);
}
}
g_variant_unref(value);
}
- } else if(connection_type == BLUETOOTH_NAP_SERVICE) {
+ } else if (connection_type == BLUETOOTH_NAP_SERVICE) {
return _bt_is_network_connected(_bt_get_net_conn(),
device_address->addr, is_connected);
} else {
return _bt_is_network_connected(_bt_get_net_conn(),
device_address->addr, is_connected);
} else {
g_variant_get(result , "(@a{sv})", &value);
g_variant_unref(result);
g_variant_get(result , "(@a{sv})", &value);
g_variant_unref(result);
- tmp_value = g_variant_lookup_value (value, "Connected", G_VARIANT_TYPE_BOOLEAN);
+ tmp_value = g_variant_lookup_value(value, "Connected", G_VARIANT_TYPE_BOOLEAN);
if (tmp_value != NULL) {
g_object_unref(device_proxy);
g_variant_unref(value);
return BLUETOOTH_ERROR_INTERNAL;
}
if (tmp_value != NULL) {
g_object_unref(device_proxy);
g_variant_unref(value);
return BLUETOOTH_ERROR_INTERNAL;
}
- *connected = g_variant_get_boolean (tmp_value);
+ *connected = g_variant_get_boolean(tmp_value);
g_variant_unref(tmp_value);
g_variant_unref(value);
g_object_unref(device_proxy);
g_variant_unref(tmp_value);
g_variant_unref(value);
g_object_unref(device_proxy);
g_dbus_proxy_call_finish(proxy, res, &err);
/* When cb datas of lescan are received, back to parameta values for Web TCT */
g_dbus_proxy_call_finish(proxy, res, &err);
/* When cb datas of lescan are received, back to parameta values for Web TCT */
- if ( _bt_is_set_scan_parameter() == FALSE) {
+ if (_bt_is_set_scan_parameter() == FALSE) {
bluetooth_le_scan_params_t scan_params;
BT_ERR("set parameter of lescan when receive cb data");
scan_params.type = BT_LE_ACTIVE_SCAN;
bluetooth_le_scan_params_t scan_params;
BT_ERR("set parameter of lescan when receive cb data");
scan_params.type = BT_LE_ACTIVE_SCAN;
le_connection_info->device_proxy = device_proxy;
/* The connection between Ble device and TM1 often fail. So It need to be set for Web TCT*/
le_connection_info->device_proxy = device_proxy;
/* The connection between Ble device and TM1 often fail. So It need to be set for Web TCT*/
- if ( _bt_is_set_scan_parameter() == FALSE) {
+ if (_bt_is_set_scan_parameter() == FALSE) {
BT_ERR("set parameter of le scan when connect device");
bluetooth_le_scan_params_t scan_params;
scan_params.type = BT_LE_ACTIVE_SCAN;
BT_ERR("set parameter of le scan when connect device");
bluetooth_le_scan_params_t scan_params;
scan_params.type = BT_LE_ACTIVE_SCAN;
msg1 = g_dbus_message_new_signal(path, BT_EVENT_SERVICE, signal);
g_dbus_message_set_body(msg1, param);
msg1 = g_dbus_message_new_signal(path, BT_EVENT_SERVICE, signal);
g_dbus_message_set_body(msg1, param);
- if (!g_dbus_connection_send_message(event_conn, msg1,G_DBUS_SEND_MESSAGE_FLAGS_NONE, 0, NULL)) {
+ if (!g_dbus_connection_send_message(event_conn, msg1, G_DBUS_SEND_MESSAGE_FLAGS_NONE, 0, NULL)) {
BT_ERR("Error while sending");
}
BT_ERR("Error while sending");
}
char *device_name = NULL;
int result = BLUETOOTH_ERROR_NONE;
GDBusProxy *transfer_properties_proxy;
char *device_name = NULL;
int result = BLUETOOTH_ERROR_NONE;
GDBusProxy *transfer_properties_proxy;
- char * bdaddress = NULL;
+ char *bdaddress = NULL;
GVariant *ret;
GVariantIter *iter;
GVariant *param = NULL;
GVariant *ret;
GVariantIter *iter;
GVariant *param = NULL;
g_conn = _bt_get_session_gconn();
retv_if(g_conn == NULL, FALSE);
properties_proxy = g_dbus_proxy_new_sync(g_conn, G_DBUS_PROXY_FLAGS_NONE,
g_conn = _bt_get_session_gconn();
retv_if(g_conn == NULL, FALSE);
properties_proxy = g_dbus_proxy_new_sync(g_conn, G_DBUS_PROXY_FLAGS_NONE,
- NULL,BT_OBEXD_DBUS_NAME,
+ NULL, BT_OBEXD_DBUS_NAME,
transfer_path, BT_PROPERTIES_INTERFACE,
NULL, &error);
transfer_path, BT_PROPERTIES_INTERFACE,
NULL, &error);
gsize len = 0;
while (g_variant_iter_loop(iter, "{sv}", &key, &val)) {
if (g_strcmp0(key, "Name") == 0) {
gsize len = 0;
while (g_variant_iter_loop(iter, "{sv}", &key, &val)) {
if (g_strcmp0(key, "Name") == 0) {
- transfer_name = g_variant_dup_string(val,&len);
+ transfer_name = g_variant_dup_string(val, &len);
} else if (g_strcmp0(key, "Filename") == 0) {
file_name = g_variant_dup_string(val, &len);
} else if (g_strcmp0(key, "Size") == 0) {
} else if (g_strcmp0(key, "Filename") == 0) {
file_name = g_variant_dup_string(val, &len);
} else if (g_strcmp0(key, "Size") == 0) {