Ejemplo n.º 1
0
void server_cleanup(context_t *c)
{
    mrp_dbus_release_name(c->dbus, SERVER_NAME, NULL);
    mrp_dbus_remove_method(c->dbus, SERVER_PATH, SERVER_INTERFACE,
                           PING, ping_handler, c);
    mrp_dbus_unref(c->dbus);
}
Ejemplo n.º 2
0
static void client_cleanup(context_t *c)
{
    mrp_dbus_follow_name(c->dbus, SERVER_NAME, server_status_cb, c);
    mrp_del_timer(c->timer);
    mrp_dbus_subscribe_signal(c->dbus, pong_handler, c,
                              c->name, SERVER_PATH, SERVER_INTERFACE,
                              PONG, NULL);
    mrp_dbus_unref(c->dbus);
}
Ejemplo n.º 3
0
void dbusif_destroy(context_t *ctx)
{
    dbusif_t *dbusif;

    if (ctx && (dbusif = ctx->dbusif)) {
        ctx->dbusif = NULL;

        mrp_dbus_unref(dbusif->dbus);

        mrp_free((void *)dbusif->bustype);
        mrp_free((void *)dbusif);
    }
}
Ejemplo n.º 4
0
static void dbusif_cleanup(dbusif_t *bus)
{
    const char     *path, *iface, *method;
    int           (*cb)(mrp_dbus_t *, mrp_dbus_msg_t *, void *);

    mrp_debug("cleaning up client D-BUS interface");

    if (bus->dbus != NULL) {
        mrp_dbus_release_name(bus->dbus, SRS_CLIENT_SERVICE, NULL);

        path   = SRS_CLIENT_PATH;
        iface  = SRS_CLIENT_INTERFACE;

        method = SRS_CLIENT_REGISTER;
        cb     = register_req;
        mrp_dbus_remove_method(bus->dbus, path, iface, method, cb, bus);

        method = SRS_CLIENT_UNREGISTER;
        cb     = unregister_req;
        mrp_dbus_remove_method(bus->dbus, path, iface, method, cb, bus);

        method = SRS_CLIENT_REQUEST_FOCUS;
        cb     = focus_req;
        mrp_dbus_remove_method(bus->dbus, path, iface, method, cb, bus);

        method = SRS_CLIENT_RENDER_VOICE;
        cb     = render_voice_req;
        mrp_dbus_remove_method(bus->dbus, path, iface, method, cb, bus);

        method = SRS_CLIENT_CANCEL_VOICE;
        cb     = cancel_voice_req;
        mrp_dbus_remove_method(bus->dbus, path, iface, method, cb, bus);

        method = SRS_CLIENT_QUERY_VOICES;
        cb     = query_voices_req;
        mrp_dbus_remove_method(bus->dbus, path, iface, method, cb, bus);

        mrp_dbus_unref(bus->dbus);
        bus->dbus = NULL;
    }
}