Ejemplo n.º 1
0
static void network_exit(void)
{
	btd_profile_unregister(&panu_profile);
	btd_profile_unregister(&gn_profile);
	btd_profile_unregister(&nap_profile);

	bnep_cleanup();
}
Ejemplo n.º 2
0
bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
{
    sdp_record_t *nap_rec, *panu_rec;
    int err;

    DBG("");

    bacpy(&adapter_addr, addr);

    nap_rec = nap_record();
    if (bt_adapter_add_record(nap_rec, SVC_HINT_NETWORKING) < 0) {
        sdp_record_free(nap_rec);
        error("Failed to allocate PAN-NAP sdp record");
        return false;
    }

    panu_rec = panu_record();
    if (bt_adapter_add_record(panu_rec, SVC_HINT_NETWORKING) < 0) {
        sdp_record_free(nap_rec);
        sdp_record_free(panu_rec);
        error("Failed to allocate PAN-PANU sdp record");
        return false;
    }

    err = bnep_init();
    if (err < 0) {
        error("Failed to init BNEP");
        bt_adapter_remove_record(nap_rec->handle);
        bt_adapter_remove_record(panu_rec->handle);
        return false;
    }

    err = register_nap_server();
    if (err < 0) {
        error("Failed to register NAP server");
        bt_adapter_remove_record(nap_rec->handle);
        bt_adapter_remove_record(panu_rec->handle);
        bnep_cleanup();
        return false;
    }

    nap_rec_id = nap_rec->handle;
    panu_rec_id = panu_rec->handle;

    hal_ipc = ipc;
    ipc_register(hal_ipc, HAL_SERVICE_ID_PAN, cmd_handlers,
                 G_N_ELEMENTS(cmd_handlers));

    return true;
}
Ejemplo n.º 3
0
void network_manager_exit(void)
{
	server_exit();

	btd_unregister_device_driver(&network_panu_driver);
	btd_unregister_device_driver(&network_gn_driver);
	btd_unregister_device_driver(&network_nap_driver);

	connection_exit();

	btd_unregister_adapter_driver(&network_server_driver);

	dbus_connection_unref(connection);
	connection = NULL;

	bnep_cleanup();
}
Ejemplo n.º 4
0
void network_manager_exit(void)
{
	if (conf->server_enabled)
		server_exit();

	if (conf->connection_enabled)
		connection_exit();

	g_dbus_unregister_interface(connection, NETWORK_PATH,
						NETWORK_MANAGER_INTERFACE);

	dbus_connection_unref(connection);
	connection = NULL;

	bnep_cleanup();
	bridge_cleanup();
}
Ejemplo n.º 5
0
void bt_pan_unregister(void)
{
    DBG("");

    g_slist_free_full(devices, pan_device_free);
    devices = NULL;
    local_role = HAL_PAN_ROLE_NONE;

    bnep_cleanup();

    ipc_unregister(hal_ipc, HAL_SERVICE_ID_PAN);
    hal_ipc = NULL;

    bt_adapter_remove_record(nap_rec_id);
    nap_rec_id = 0;
    bt_adapter_remove_record(panu_rec_id);
    panu_rec_id = 0;
    destroy_nap_device();
}