return FALSE;
server = g_malloc0(sizeof(bt_agent_osp_server_t));
- retv_if(server == NULL, FALSE);
-
server->type = type;
if (type == BT_RFCOMM_SERVER) {
server->uuid = g_strdup(uuid);
if (accept == GAP_AGENT_ACCEPT) {
g_dbus_method_invocation_return_value(priv->reply_context, NULL);
} else if (accept == GAP_AGENT_ACCEPT_ALWAYS) {
- bluetooth_device_address_t addr = {{0,}};
+ bluetooth_device_address_t addr = { { 0, } };
int result;
_bt_convert_addr_string_to_type(addr.addr,
"CanceledbyUser");
break;
case GAP_AGENT_REJECT: {
- bluetooth_device_address_t addr = {{0,}};
+ bluetooth_device_address_t addr = { { 0, } };
int result;
_bt_convert_addr_string_to_type(addr.addr,
}
reply = g_dbus_proxy_call_sync(agent_manager, "UnregisterAgent",
- g_variant_new("o", priv->path),
+ g_variant_new("(o)", priv->path),
G_DBUS_CALL_FLAGS_NONE, -1,
NULL, &error);
g_object_unref(agent_manager);
if (!agent->cb.passkey_func)
return;
- conn = _bt_get_system_gconn();
+ conn = _bt_gdbus_get_system_gconn();
if (conn == NULL)
return;
addr += 4;
g_strlcpy(agent->pairing_addr, addr, sizeof(agent->pairing_addr));
- while ((pos = strchr(agent->pairing_addr, '_')) != NULL) {
+ while ((pos = strchr(agent->pairing_addr, '_')) != NULL)
*pos = ':';
- }
}
agent->cb.pincode_func(agent, device);
if (!priv->cb.passkey_func)
return;
- conn = _bt_get_system_gconn();
+ conn = _bt_gdbus_get_system_gconn();
if (conn == NULL)
return;
addr += 4;
g_strlcpy(priv->pairing_addr, addr, sizeof(priv->pairing_addr));
- while ((pos = strchr(priv->pairing_addr, '_')) != NULL) {
+ while ((pos = strchr(priv->pairing_addr, '_')) != NULL)
*pos = ':';
- }
}
priv->cb.passkey_func(priv, device);
if (!priv->cb.display_func)
return;
- conn = _bt_get_system_gconn();
+ conn = _bt_gdbus_get_system_gconn();
if (conn == NULL)
return;
if (!priv->cb.confirm_func)
return;
- conn = _bt_get_system_gconn();
+ conn = _bt_gdbus_get_system_gconn();
if (conn == NULL)
return;
addr += 4;
g_strlcpy(priv->pairing_addr, addr, sizeof(priv->pairing_addr));
- while ((pos = strchr(priv->pairing_addr, '_')) != NULL) {
+ while ((pos = strchr(priv->pairing_addr, '_')) != NULL)
*pos = ':';
- }
}
priv->cb.confirm_func(priv, device, passkey);
if (!priv->cb.authorize_func)
return;
- conn = _bt_get_system_gconn();
+ conn = _bt_gdbus_get_system_gconn();
if (conn == NULL)
return;
g_strlcpy(priv->authorize_addr, addr,
sizeof(priv->authorize_addr));
- while ((pos = strchr(priv->authorize_addr, '_')) != NULL) {
+ while ((pos = strchr(priv->authorize_addr, '_')) != NULL)
*pos = ':';
- }
}
priv->cb.authorize_func(priv, device, uuid);
priv->busname = NULL;
} else {
priv->busname = g_strdup(g_dbus_proxy_get_name(proxy));
- g_object_unref(proxy);
BT_DBG("Busname: %s", priv->busname);
+ g_object_unref(proxy);
}
}
osp_serv = __gap_agent_find_server(priv->osp_servers,
type, uuid);
- if (!osp_serv) {
+ if (!osp_serv)
return NULL;
- }
return osp_serv;
}