本文整理汇总了C++中GDBUS_METHOD函数的典型用法代码示例。如果您正苦于以下问题:C++ GDBUS_METHOD函数的具体用法?C++ GDBUS_METHOD怎么用?C++ GDBUS_METHOD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GDBUS_METHOD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: control_property_get_connected
}
static gboolean control_property_get_connected(
const GDBusPropertyTable *property,
DBusMessageIter *iter, void *data)
{
struct control *control = data;
dbus_bool_t value = (control->session != NULL);
dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &value);
return TRUE;
}
static const GDBusMethodTable control_methods[] = {
{ GDBUS_METHOD("Play", NULL, NULL, control_play) },
{ GDBUS_METHOD("Pause", NULL, NULL, control_pause) },
{ GDBUS_METHOD("Stop", NULL, NULL, control_stop) },
{ GDBUS_METHOD("Next", NULL, NULL, control_next) },
{ GDBUS_METHOD("Previous", NULL, NULL, control_previous) },
{ GDBUS_METHOD("VolumeUp", NULL, NULL, control_volume_up) },
{ GDBUS_METHOD("VolumeDown", NULL, NULL, control_volume_down) },
{ GDBUS_METHOD("FastForward", NULL, NULL, control_fast_forward) },
{ GDBUS_METHOD("Rewind", NULL, NULL, control_rewind) },
{ }
};
static const GDBusPropertyTable control_properties[] = {
{ "Connected", "b", control_property_get_connected },
{ }
};
示例2: set_online
set_online(modem, FALSE);
modem_change_state(modem, MODEM_STATE_POWER_OFF);
}
return NULL;
}
if (g_str_equal(name, "Lockdown"))
return set_property_lockdown(modem, msg, &var);
return __ofono_error_invalid_args(msg);
}
static const GDBusMethodTable modem_methods[] = {
{ GDBUS_METHOD("GetProperties",
NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
modem_get_properties) },
{ GDBUS_ASYNC_METHOD("SetProperty",
GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
NULL, modem_set_property) },
{ }
};
static const GDBusSignalTable modem_signals[] = {
{ GDBUS_SIGNAL("PropertyChanged",
GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
{ }
};
void ofono_modem_set_powered(struct ofono_modem *modem, ofono_bool_t powered)
{
示例3: btd_error_does_not_exist
return btd_error_does_not_exist(msg);
hradapter->watchers = g_slist_remove(hradapter->watchers, watcher);
g_dbus_remove_watch(conn, watcher->id);
if (g_slist_length(hradapter->watchers) == 0)
g_slist_foreach(hradapter->devices, disable_measurement, 0);
DBG("heartrate watcher [%s] unregistered", path);
return dbus_message_new_method_return(msg);
}
static const GDBusMethodTable heartrate_manager_methods[] = {
{ GDBUS_METHOD("RegisterWatcher",
GDBUS_ARGS({ "agent", "o" }), NULL,
register_watcher) },
{ GDBUS_METHOD("UnregisterWatcher",
GDBUS_ARGS({ "agent", "o" }), NULL,
unregister_watcher) },
{ }
};
static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg,
void *data)
{
struct heartrate *hr = data;
DBusMessageIter iter;
DBusMessageIter dict;
DBusMessage *reply;
gboolean has_reset;
示例4: g_dbus_unregister_interface
g_dbus_unregister_interface(conn, AD_PATH, AD_IFACE);
}
static DBusMessage *release_advertising(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
rl_printf("Advertising released\n");
ad_release(conn);
return dbus_message_new_method_return(msg);
}
static const GDBusMethodTable ad_methods[] = {
{ GDBUS_METHOD("Release", NULL, NULL, release_advertising) },
{ }
};
static void register_setup(DBusMessageIter *iter, void *user_data)
{
DBusMessageIter dict;
const char *path = AD_PATH;
dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path);
dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
DBUS_TYPE_STRING_AS_STRING
DBUS_TYPE_VARIANT_AS_STRING
DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
dbus_message_iter_close_container(iter, &dict);
示例5: dbus_message_new_method_return
return dbus_message_new_method_return(msg);
error:
return g_dbus_create_error(msg,
BLUEZ_ERROR_INTERFACE ".Rejected",
"Invalid arguments in method call");
}
static const GDBusMethodTable profile_methods[] = {
{ GDBUS_ASYNC_METHOD("NewConnection",
GDBUS_ARGS({ "device", "o"}, { "fd", "h"},
{ "fd_properties", "a{sv}" }),
NULL, profile_new_connection) },
{ GDBUS_NOREPLY_METHOD("Release", NULL, NULL, profile_release) },
{ GDBUS_METHOD("RequestDisconnection",
GDBUS_ARGS({"device", "o"}), NULL,
profile_disconnection) },
{ }
};
static void connect_handler(DBusConnection *conn, void *user_data)
{
uint16_t features = HFP_SDP_HF_FEATURE_ECNR |
HFP_SDP_HF_FEATURE_3WAY |
HFP_SDP_HF_FEATURE_CLIP |
HFP_SDP_HF_FEATURE_REMOTE_VOLUME_CONTROL;
/*
* Assuming that if defer_setup is supported, then SCO transparent
* mode is also supported
*/
示例6: __connman_error_failed
if (err < 0)
return __connman_error_failed(msg, -err);
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
static const GDBusMethodTable manager_methods[] = {
{ GDBUS_ASYNC_METHOD("Create",
GDBUS_ARGS({ "properties", "a{sv}" }),
GDBUS_ARGS({ "path", "o" }),
create) },
{ GDBUS_ASYNC_METHOD("Remove",
GDBUS_ARGS({ "identifier", "o" }), NULL,
remove) },
{ GDBUS_METHOD("GetConnections", NULL,
GDBUS_ARGS({ "connections", "a(oa{sv})" }),
get_connections) },
{ GDBUS_METHOD("RegisterAgent",
GDBUS_ARGS({ "path", "o" }), NULL,
register_agent) },
{ GDBUS_METHOD("UnregisterAgent",
GDBUS_ARGS({ "path", "o" }), NULL,
unregister_agent) },
{ },
};
static const GDBusSignalTable manager_signals[] = {
{ GDBUS_SIGNAL("ConnectionAdded",
GDBUS_ARGS({ "identifier", "o" },
{ "properties", "a{sv}" })) },
{ GDBUS_SIGNAL("ConnectionRemoved",
示例7: dbus_message_ref
dbus_message_ref(message);
return NULL;
fail:
reply = g_dbus_create_error(message,
"org.openobex.Error.Failed",
"%s", gerr->message);
g_error_free(gerr);
return reply;
}
static const GDBusMethodTable session_methods[] = {
{ GDBUS_METHOD("GetProperties",
NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
session_get_properties) },
{ GDBUS_ASYNC_METHOD("GetCapabilities",
NULL, GDBUS_ARGS({ "capabilities", "s" }),
get_capabilities) },
{ }
};
static gboolean session_queue_complete(gpointer data)
{
struct obc_session *session = data;
session_process_queue(session);
session->queue_complete_id = 0;
示例8: __ofono_error_busy
if (hf->pending)
return __ofono_error_busy(msg);
if (!hf->driver->request_phone_number)
return __ofono_error_not_supported(msg);
hf->pending = dbus_message_ref(msg);
hf->driver->request_phone_number(hf, request_phone_number_cb, hf);
return NULL;
}
static const GDBusMethodTable handsfree_methods[] = {
{ GDBUS_METHOD("GetProperties",
NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
handsfree_get_properties) },
{ GDBUS_ASYNC_METHOD("SetProperty",
GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
NULL, handsfree_set_property) },
{ GDBUS_ASYNC_METHOD("RequestPhoneNumber",
NULL, GDBUS_ARGS({ "number", "s" }),
handsfree_request_phone_number) },
{ }
};
static const GDBusSignalTable handsfree_signals[] = {
{ GDBUS_SIGNAL("PropertyChanged",
GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
{ }
};
示例9: transfer_get_transferred
}
static gboolean transfer_get_transferred(const GDBusPropertyTable *property,
DBusMessageIter *iter, void *data)
{
struct obex_transfer *transfer = data;
struct obex_session *session = transfer->session;
dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT64,
&session->offset);
return TRUE;
}
static const GDBusMethodTable manager_methods[] = {
{ GDBUS_METHOD("RegisterAgent",
GDBUS_ARGS({ "agent", "o" }), NULL, register_agent) },
{ GDBUS_METHOD("UnregisterAgent",
GDBUS_ARGS({ "agent", "o" }), NULL, unregister_agent) },
{ }
};
static const GDBusMethodTable transfer_methods[] = {
{ GDBUS_METHOD("Cancel", NULL, NULL, transfer_cancel) },
{ }
};
static const GDBusPropertyTable transfer_properties[] = {
{ "Status", "s", transfer_get_status },
{ "Session", "o", transfer_get_session },
{ "Name", "s", transfer_get_name, NULL, transfer_name_exists },
{ "Type", "s", transfer_get_type, NULL, transfer_type_exists },
示例10: dbus_message_new_method_return
info->chat = NULL;
return dbus_message_new_method_return(msg);
error:
return g_dbus_create_error(msg,
BLUEZ_ERROR_INTERFACE ".Rejected",
"Invalid arguments in method call");
}
static const GDBusMethodTable profile_methods[] = {
{ GDBUS_ASYNC_METHOD("NewConnection",
GDBUS_ARGS({ "device", "o"}, { "fd", "h"},
{ "fd_properties", "a{sv}" }),
NULL, profile_new_connection) },
{ GDBUS_METHOD("Release", NULL, NULL, profile_release) },
{ GDBUS_METHOD("Cancel", NULL, NULL, profile_cancel) },
{ GDBUS_METHOD("RequestDisconnection",
GDBUS_ARGS({"device", "o"}), NULL,
profile_disconnection) },
{ }
};
static void connect_handler(DBusConnection *conn, void *user_data)
{
DBG("Registering External Profile handler ...");
bt_register_profile(conn, HFP_HS_UUID, HFP_VERSION_1_6, "hfp_hf",
HFP_EXT_PROFILE_PATH);
}
示例11: g_new
"Invalid signature for '%s'", name);
propdata = g_new(struct property_data, 1);
propdata->id = next_pending_property++;
propdata->message = dbus_message_ref(message);
propdata->conn = connection;
pending_property_set = g_slist_prepend(pending_property_set, propdata);
property->set(property, &sub, propdata->id, iface->user_data);
return NULL;
}
static const GDBusMethodTable properties_methods[] = {
{ GDBUS_METHOD("Get",
GDBUS_ARGS({ "interface", "s" }, { "name", "s" }),
GDBUS_ARGS({ "value", "v" }),
properties_get) },
{ GDBUS_ASYNC_METHOD("Set",
GDBUS_ARGS({ "interface", "s" }, { "name", "s" },
{ "value", "v" }),
NULL,
properties_set) },
{ GDBUS_METHOD("GetAll",
GDBUS_ARGS({ "interface", "s" }),
GDBUS_ARGS({ "properties", "a{sv}" }),
properties_get_all) },
{ }
};
static const GDBusSignalTable properties_signals[] = {
{ GDBUS_SIGNAL("PropertiesChanged",
示例12: set_status
void *data)
{
set_status(property, iter, id, STATUS_READ, data);
}
static void set_deleted(const GDBusPropertyTable *property,
DBusMessageIter *iter, GDBusPendingPropertySet id,
void *data)
{
set_status(property, iter, id, STATUS_DELETE, data);
}
static const GDBusMethodTable map_msg_methods[] = {
{ GDBUS_METHOD("Get",
GDBUS_ARGS({ "targetfile", "s" },
{ "attachment", "b" }),
GDBUS_ARGS({ "transfer", "o" },
{ "properties", "a{sv}" }),
map_msg_get) },
{ }
};
static const GDBusPropertyTable map_msg_properties[] = {
{ "Subject", "s", get_subject, NULL, subject_exists },
{ "Timestamp", "s", get_timestamp, NULL, timestamp_exists },
{ "Sender", "s", get_sender, NULL, sender_exists },
{ "SenderAddress", "s", get_sender_address, NULL,
sender_address_exists },
{ "ReplyTo", "s", get_replyto, NULL, replyto_exists },
{ "Recipient", "s", get_recipient, NULL, recipient_exists },
{ "RecipientAddress", "s", get_recipient_address, NULL,
recipient_address_exists },
示例13: DBG
DBG("%s", mgr->sender);
if (strncmp(sender, mgr->sender, strlen(mgr->sender)))
return error_permission_denied(msg);
/* remove it */
near_p2p_unregister(mgr->p2p_driver);
g_hash_table_remove(mgr_list, mgr->p2p_driver->service_name);
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
static const GDBusMethodTable phdc_methods[] = {
{ GDBUS_METHOD("RegisterAgent",
GDBUS_ARGS({"", "a{sv}"}),
NULL, dbus_register_phdc_agent) },
{ GDBUS_METHOD("UnregisterAgent",
GDBUS_ARGS({ "path", "o" }, { "type", "s"}),
NULL, dbus_unregister_phdc_agent) },
{ },
};
/* Initialize the PHDC plugin - Expose our dbus entry points */
int phdc_init(void)
{
gboolean err;
DBG("");
示例14: g_assert
break;
default:
g_assert(FALSE);
return __connman_error_invalid_arguments(msg);
}
dbus_message_iter_next(&array);
}
if (session->notify != NULL)
session->notify(session);
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
static const GDBusMethodTable notify_methods[] = {
{ GDBUS_METHOD("Release", NULL, NULL, notify_release) },
{ GDBUS_METHOD("Update",
GDBUS_ARGS({ "settings", "a{sv}" }), NULL,
notify_update) },
{ },
};
int session_notify_register(struct test_session *session,
const char *notify_path)
{
if (g_dbus_register_interface(session->connection, notify_path,
CONNMAN_NOTIFICATION_INTERFACE,
notify_methods, NULL, NULL,
session, NULL) == FALSE) {
return -EINVAL;
}
示例15: bt_shell_printf
}
static DBusMessage *cancel_request(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
bt_shell_printf("Request canceled\n");
agent_release_prompt();
dbus_message_unref(pending_message);
pending_message = NULL;
return dbus_message_new_method_return(msg);
}
static const GDBusMethodTable methods[] = {
{ GDBUS_METHOD("Release", NULL, NULL, release_agent) },
{ GDBUS_ASYNC_METHOD("RequestPinCode",
GDBUS_ARGS({ "device", "o" }),
GDBUS_ARGS({ "pincode", "s" }), request_pincode) },
{ GDBUS_METHOD("DisplayPinCode",
GDBUS_ARGS({ "device", "o" }, { "pincode", "s" }),
NULL, display_pincode) },
{ GDBUS_ASYNC_METHOD("RequestPasskey",
GDBUS_ARGS({ "device", "o" }),
GDBUS_ARGS({ "passkey", "u" }), request_passkey) },
{ GDBUS_METHOD("DisplayPasskey",
GDBUS_ARGS({ "device", "o" }, { "passkey", "u" },
{ "entered", "q" }),
NULL, display_passkey) },
{ GDBUS_ASYNC_METHOD("RequestConfirmation",
GDBUS_ARGS({ "device", "o" }, { "passkey", "u" }),