retv_if(!addr, NULL);
bt_le_adv_info_t *adv_info = NULL;
GList *current = g_list_first((GList *)p_adv_ind_list);
- while(current && current->data) {
+ while (current && current->data) {
adv_info = (bt_le_adv_info_t *)current->data;
retv_if(adv_info && !g_strcmp0(adv_info->addr, addr), adv_info);
current = g_list_next(current);
ret_if(!p_adv_ind_list);
bt_le_adv_info_t *adv_info = NULL;
GList *current = g_list_first((GList *)p_adv_ind_list);
- while(current && current->data) {
+ while (current && current->data) {
adv_info = (bt_le_adv_info_t *)current->data;
if (adv_info && !g_strcmp0(adv_info->addr, addr)) {
p_adv_ind_list = g_list_remove(p_adv_ind_list, adv_info);
} else if (strcasecmp(key, "UUIDs") == 0) {
char **uuid_value;
gsize size = 0;
- int i =0;
+ int i = 0;
size = g_variant_get_size(val);
if (size > 0) {
GVariant *optional_param;
GVariantIter iter;
GVariant *child;
- char *interface_name= NULL;
+ char *interface_name = NULL;
GVariant *inner_iter = NULL;
g_variant_get(msg, "(&o@a{sa{sv}})",
&path, &optional_param);
g_variant_iter_init(&iter, optional_param);
while ((child = g_variant_iter_next_value(&iter))) {
- g_variant_get(child,"{&s@a{sv}}", &interface_name, &inner_iter);
+ g_variant_get(child, "{&s@a{sv}}", &interface_name, &inner_iter);
if (g_strcmp0(interface_name, BT_DEVICE_INTERFACE) == 0) {
BT_DBG("Found a device: %s", path);
if (__bt_parse_device_properties(inner_iter,
node = g_list_first(p_cache_list);
- while (node != NULL){
+ while (node != NULL) {
cache_info = (bt_cache_info_t *)node->data;
if (cache_info == NULL) {
GVariant *param = NULL;
BT_DBG("+");
- if (remote_dev_info->uuid_count > 0 ) {
- for (i = 0; i<remote_dev_info->uuid_count; i++) {
+ if (remote_dev_info->uuid_count > 0) {
+ for (i = 0; i < remote_dev_info->uuid_count; i++) {
char *uuid = remote_dev_info->uuids[i];
- if (strcasecmp(uuid, HID_UUID) == 0){
+ if (strcasecmp(uuid, HID_UUID) == 0) {
int event = BLUETOOTH_EVENT_NONE;
event = (connected == TRUE) ?
node = g_list_first(p_cache_list);
- while (node != NULL){
+ while (node != NULL) {
cache_info = (bt_cache_info_t *)node->data;
if (cache_info == NULL) {
gboolean status = FALSE;
char *address = NULL;
int link_type;
- g_variant_get(msg,"(sib)", &address, &link_type, &status);
+ g_variant_get(msg, "(sib)", &address, &link_type, &status);
BT_DBG("RSSI Enabled [%s %d]", address, status);
param = g_variant_new("(isib)", result,
int rssi_dbm;
int link_type;
char *address = NULL;
- g_variant_get(msg,"(siii)", &address, &link_type, &alert_type, &rssi_dbm);
+ g_variant_get(msg, "(siii)", &address, &link_type, &alert_type, &rssi_dbm);
BT_DBG("RSSI Alert: [Address %s LinkType %d] [Type %d DBM %d]",
address, alert_type, rssi_dbm);
int rssi_dbm;
int link_type;
char *address = NULL;
- g_variant_get(msg,"(sii)", &address, &link_type, &rssi_dbm);
+ g_variant_get(msg, "(sii)", &address, &link_type, &rssi_dbm);
BT_DBG("Raw RSSI: [Address %s] [Link Type %d][RSSI DBM %d]",
address, link_type, rssi_dbm);
GError *err = NULL;
char *property = NULL;
GVariant *param = NULL;
- g_variant_iter_init (&value_iter, msg);
- while ((g_variant_iter_loop (&value_iter,"{sv}", &property, &val))) {
+ g_variant_iter_init(&value_iter, msg);
+ while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
BT_INFO("Property %s", property);
if (strcasecmp(property, "Discovering") == 0) {
gboolean powered = FALSE;
int bt_state;
- g_variant_get(val, "b" ,&powered);
+ g_variant_get(val, "b", &powered);
BT_DBG("Powered = %d", powered);
if (powered == FALSE) {
#ifdef USB_BLUETOOTH
bt_state != VCONFKEY_BT_LE_STATUS_OFF) {
_bt_set_le_disabled(BLUETOOTH_ERROR_NONE);
}
- }
- else {
+ } else {
#ifdef USB_BLUETOOTH
_bt_handle_adapter_added();
#endif
GVariantIter value_iter;
GVariant *child = NULL, *val = NULL;
char *property = NULL;
- g_variant_iter_init (&value_iter, msg);
- while ((child = g_variant_iter_next_value (&value_iter))) {
+ g_variant_iter_init(&value_iter, msg);
+ while ((child = g_variant_iter_next_value(&value_iter))) {
g_variant_get(child, "{sv}", &property, &val);
ret_if(property == NULL);
char *status;
g_variant_get(val, "s", &status);
- if (strcasecmp(status, "active") == 0){
+ if (strcasecmp(status, "active") == 0) {
_bt_obex_transfer_started(path);
} else if (strcasecmp(status, "complete") == 0) {
_bt_obex_transfer_completed(path, TRUE);
_bt_pbap_obex_transfer_completed(path, TRUE);
- } else if (strcasecmp(status, "error") == 0){
+ } else if (strcasecmp(status, "error") == 0) {
_bt_obex_transfer_completed(path, FALSE);
_bt_pbap_obex_transfer_completed(path, FALSE);
}
static int transferred = 0;
g_variant_get(val, "t", &transferred);
- _bt_obex_transfer_progress(path,transferred);
+ _bt_obex_transfer_progress(path, transferred);
}
g_free(property);
g_variant_unref(val);
char *address;
GVariant *param = NULL;
bt_remote_dev_info_t *remote_dev_info;
- g_variant_iter_init (&value_iter, msg);
+ g_variant_iter_init(&value_iter, msg);
while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
BT_DBG("Property %s", property);
if (strcasecmp(property, "Connected") == 0) {
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]);
}
return;
}
- if(paired == FALSE) {
+ if (paired == FALSE) {
BT_INFO("Unpaired: %s", address);
__bt_update_remote_cache_devinfo(address, FALSE);
param = g_variant_new("(is)", result, address);
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]);
}
GVariant *child = NULL;
bt_remote_dev_info_t *remote_dev_info;
GVariant *param = NULL;
- g_variant_iter_init (&value_iter, msg);
- while ((child = g_variant_iter_next_value (&value_iter))) {
+ g_variant_iter_init(&value_iter, msg);
+ while ((child = g_variant_iter_next_value(&value_iter))) {
g_variant_get(child, "{sv}", &property, &val);
BT_INFO("Property %s", property);
if (strcasecmp(property, "Connected") == 0) {
char *interface_name = NULL;
GVariant *val = NULL;
- g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, &val,NULL);
+ g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, &val, NULL);
if (strcasecmp(interface_name, BT_ADAPTER_INTERFACE) == 0) {
__bt_adapter_property_changed_event(val,
object_path);
} else if (strcasecmp(interface_name, BT_DEVICE_INTERFACE) == 0) {
- __bt_device_property_changed_event(val,object_path);
+ __bt_device_property_changed_event(val, object_path);
} else if (strcasecmp(interface_name, BT_OBEX_TRANSFER_INTERFACE) == 0) {
BT_DBG("BT_OBEX_TRANSFER_INTERFACE");
__bt_obex_property_changed_event(val,
GVariant *val = NULL;
GVariant *child = NULL;
- g_variant_iter_init (&value_iter, msg);
- while ((child = g_variant_iter_next_value (&value_iter))) {
+ g_variant_iter_init(&value_iter, msg);
+ while ((child = g_variant_iter_next_value(&value_iter))) {
g_variant_get(child, "{sv}", &property, &val);
ret_if(property == NULL);
g_variant_get(val, "s", &status);
BT_DBG("Status is %s", status);
- if(strcasecmp(status, "active") == 0){
+ if (strcasecmp(status, "active") == 0) {
_bt_obex_client_started(path);
- }else if (strcasecmp(status, "complete") == 0) {
+ } else if (strcasecmp(status, "complete") == 0) {
_bt_obex_client_completed(path, TRUE);
- }else if (strcasecmp(status, "error") == 0){
+ } else if (strcasecmp(status, "error") == 0) {
_bt_obex_client_completed(path, FALSE);
}
g_free(status);
GVariant *child = NULL, *val = NULL;
bt_remote_dev_info_t *remote_dev_info;
GVariant *param = NULL;
- g_variant_iter_init (&value_iter, msg);
- while ((child = g_variant_iter_next_value (&value_iter))) {
+ g_variant_iter_init(&value_iter, msg);
+ while ((child = g_variant_iter_next_value(&value_iter))) {
g_variant_get(child, "{sv}", &property, &val);
ret_if(property == NULL);
GVariant *val = NULL;
GVariantIter value_iter;
GVariant *param = NULL;
- g_variant_iter_init (&value_iter, msg);
+ g_variant_iter_init(&value_iter, msg);
while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
if (strcasecmp(property, "Connected") == 0) {
int event = BLUETOOTH_EVENT_NONE;
GVariant *val = NULL;
int result = BLUETOOTH_ERROR_NONE;
GVariant *param = NULL;
- g_variant_iter_init (&value_iter, msg);
+ g_variant_iter_init(&value_iter, msg);
char_handle = g_strdup(path);
while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
BT_INFO("Property %s", property);
} else if (strcasecmp(property, "ChangedValue") == 0) {
int len = 0;
GByteArray *gp_byte_array = NULL;
- BT_INFO("Type '%s'\n", g_variant_get_type_string (val));
+ BT_INFO("Type '%s'\n", g_variant_get_type_string(val));
if (val) {
gp_byte_array = g_byte_array_new();
len = g_variant_get_size(val);
BT_DBG("Len = %d", len);
- g_byte_array_append (gp_byte_array,
+ g_byte_array_append(gp_byte_array,
(const guint8 *) g_variant_get_data(val), len);
if (gp_byte_array->len != 0) {
GVariant *byte_array = NULL;
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]);
}
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]);
}
*/
_bt_obex_check_pending_transfer(address);
_bt_opp_client_is_sending(&sending);
- if(sending == TRUE)
+ if (sending == TRUE)
_bt_opp_client_check_pending_transfer(address);
param = g_variant_new("(isy)", result, address, addr_type);
_bt_send_event(BT_DEVICE_EVENT,
GVariant *child = NULL;
GVariant *val = NULL;
GVariant *param = NULL;
- g_variant_iter_init (&value_iter, msg);
- while ((child = g_variant_iter_next_value (&value_iter))) {
+ g_variant_iter_init(&value_iter, msg);
+ while ((child = g_variant_iter_next_value(&value_iter))) {
g_variant_get(child, "{sv}", &property, &val);
wait_list->out_param1);
}
g_free(address);
- }else if (strcasecmp(value, "Connected") == 0) {
+ } else if (strcasecmp(value, "Connected") == 0) {
char *address;
char connected_address[BT_ADDRESS_STRING_SIZE + 1];
bluetooth_device_address_t device_address;
node = g_list_first(p_cache_list);
- while (node != NULL){
+ while (node != NULL) {
cache_info = (bt_cache_info_t *)node->data;
p_cache_list = g_list_remove(p_cache_list, cache_info);
__bt_free_cache_info(cache_info);
{
GVariantIter iter;
GVariant *child;
- char *interface_name= NULL;
+ char *interface_name = NULL;
GVariant *inner_iter = NULL;
g_variant_iter_init(&iter, msg);
while ((child = g_variant_iter_next_value(&iter))) {
- g_variant_get(child,"{&s@a{sv}}", &interface_name, &inner_iter);
+ g_variant_get(child, "{&s@a{sv}}", &interface_name, &inner_iter);
if (g_strcmp0(interface_name,
BT_DEVICE_INTERFACE) == 0) {
g_variant_unref(inner_iter);
#else
_bt_handle_adapter_added();
#endif
- }
- else {
+ } else {
bt_event = __bt_parse_event(value);
if (bt_event == BT_DEVICE_EVENT) {
bt_cache_info_t *cache_info;
GVariantBuilder *builder = NULL;
int i = 0;
builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
- for (i=0; i < dev_info->uuid_count; i++) {
+ for (i = 0; i < dev_info->uuid_count; i++) {
g_variant_builder_add(builder, "s",
dev_info->uuids[i]);
}
if (g_strcmp0(interface, BT_PROPERTIES_INTERFACE) == 0) {
char *interface_name = NULL;
- g_variant_get(msg,"(&s@a{sv}@as)", &interface_name, NULL, NULL);
+ g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, NULL, NULL);
retv_if(interface_name == NULL, FALSE);
if (strcasecmp(interface_name, BT_OBEX_TRANSFER_INTERFACE) == 0) {
if (g_strcmp0(interface, BT_PROPERTIES_INTERFACE) == 0) {
char *interface_name = NULL;
- g_variant_get(msg,"(&s@a{sv}@as)", &interface_name, NULL, NULL);
+ g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, NULL, NULL);
retv_if(interface_name == NULL, FALSE);
char *obj_path = NULL;
if (strcasecmp(member, "InterfacesAdded") == 0) {
BT_DBG("InterfacesAdded");
- }else if (strcasecmp(member, "InterfacesRemoved") == 0) {
+ } else if (strcasecmp(member, "InterfacesRemoved") == 0) {
if (__bt_get_object_path(parameters, &obj_path)) {
BT_ERR("Fail to get the path");
return;
}
- BT_DBG("object_path =%s",obj_path);
+ BT_DBG("object_path = %s", obj_path);
if (strncmp(obj_path, BT_SESSION_BASEPATH_CLIENT,
strlen(BT_SESSION_BASEPATH_CLIENT)) != 0
|| strstr(obj_path, "transfer") == NULL) {
g_free(obj_path);
return;
- }
- else if (strncmp(obj_path, BT_SESSION_BASEPATH_CLIENT,
+ } else if (strncmp(obj_path, BT_SESSION_BASEPATH_CLIENT,
strlen(BT_SESSION_BASEPATH_CLIENT)) == 0) {
BT_DBG("Going to call opc disconnected");
_bt_opc_disconnected(obj_path);
_bt_sending_files();
g_free(obj_path);
- }else if (__bt_is_obexd_client_event(parameters, interface_name) == TRUE){
+ } else if (__bt_is_obexd_client_event(parameters, interface_name) == TRUE) {
char *path = (char *)object_path;
BT_INFO("object_path %s", path);
if (strncmp(path, BT_SESSION_BASEPATH_CLIENT,