Exemple #1
0
DSME_HANDLER(DSM_MSGTYPE_DBUS_CONNECT, client, msg)
{
  dsme_log(LOG_DEBUG, PFIX"DBUS_CONNECT");
  dsme_dbus_bind_signals(&bound, signals);
#ifdef DSME_VIBRA_FEEDBACK
  dsme_ini_vibrafeedback();
#endif // DSME_VIBRA_FEEDBACK
}
Exemple #2
0
DSME_HANDLER(DSM_MSGTYPE_DBUS_CONNECT, client, msg)
{
    dsme_log(LOG_DEBUG, "usbtracker: DBUS_CONNECT");
    dsme_dbus_bind_signals(&bound, signals);

    /* we are connected on dbus, now we can query
     * charger/usb connection details */

    DBusError        err  = DBUS_ERROR_INIT;
    DBusPendingCall *pc   = 0;
    DBusConnection  *conn = 0;
    DBusMessage     *req  = NULL;

    if( !(conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err)) )
    {
        dsme_log(LOG_ERR, "DBUS_BUS_SYSTEM: %s: %s",
                 err.name, err.message);
        goto cleanup;
    }

    req = dbus_message_new_method_call("com.meego.usb_moded",
                                       "/com/meego/usb_moded",
                                       "com.meego.usb_moded",
                                       "mode_request");
    if( !req )
        goto cleanup;

    if( !dbus_connection_send_with_reply(conn, req, &pc, -1) )
        goto cleanup;

    if( !dbus_pending_call_set_notify(pc, mode_request_cb, 0, 0) )
        goto cleanup;

    dsme_log(LOG_DEBUG, "usbtracker: mode_request sent");

cleanup:

    if( pc ) dbus_pending_call_unref(pc);
    if( req ) dbus_message_unref(req);
    if( conn ) dbus_connection_unref(conn);
    dbus_error_free(&err);
}
Exemple #3
0
static void loader_needed_cb(DBusPendingCall *pending, void *user_data)
{
    (void)user_data;

    DBusMessage *rsp = 0;
    DBusError    err = DBUS_ERROR_INIT;

    if (!(rsp = dbus_pending_call_steal_reply(pending)))
        goto cleanup;

    if (dbus_set_error_from_message(&err, rsp)) {
        dsme_log(LOG_DEBUG, "wlanloader: disabled, GetUnit: %s: %s",
                                                    err.name, err.message);
    } else {
        /* We got the reply without error, so the service exists */
        dsme_dbus_bind_signals(&bound, signals);
        dsme_log(LOG_DEBUG, "wlanloader: activated");
    }

cleanup:
    if (rsp) dbus_message_unref(rsp);
    dbus_error_free(&err);
}
DSME_HANDLER(DSM_MSGTYPE_DBUS_CONNECT, client, msg)
{
  dsme_log(LOG_DEBUG, "DBUS_CONNECT");
  dsme_dbus_bind_signals(&bound, signals);
}