"<method name='ReacherIsRunning'>"
"<arg type='b' name='is_running' direction='out'/>"
"</method>"
-/* Test purpose --> */
- "<property type='b' name='WritingAlwaysThrowsError' access='readwrite'/>"
- "<property type='b' name='ReadingAlwaysThrowsError' access='read'/>"
-/* <-- Test purpose */
"<signal name='IpConflicted'>"
"</signal>"
"<signal name='ConnectionsChanged'>"
static const gchar inm_wifi_introspection_xml[] = {
"<node>"
"<interface name='net.inm_manager.wifi'>"
- "<method name='GetConnectedAp'>"
- "<arg type='a{sv}' name='ap' direction='out'/>"
- "</method>"
- "<method name='GetFoundAps'>"
- "<arg type='a(oa{sv})' name='connections' direction='out'/>"
- "</method>"
"<method name='GetScanState'>"
"<arg type='b' name='scan_state' direction='out'/>"
"</method>"
-/* Test purpose --> */
- "<property type='b' name='WritingAlwaysThrowsError' access='readwrite'/>"
- "<property type='b' name='ReadingAlwaysThrowsError' access='read'/>"
-/* <-- Test purpose */
"</interface>"
"</node>"
};
"<property type='s' name='DisconnectReason' access='read'/>"
"<property type='s' name='AssocStatus' access='read'/>"
"<property type='s' name='Vsie' access='read'/>"
-/* Test purpose --> */
- "<property type='b' name='WritingAlwaysThrowsError' access='readwrite'/>"
- "<property type='b' name='ReadingAlwaysThrowsError' access='read'/>"
-/* <-- Test purpose */
"</interface>"
"</node>"
};
__handle_reacher_is_running(parameters, invocation);
}
-static inline GVariant *__get_reading_error(const gchar *sender, GError **error)
-{
- __INM_FUNC_ENTER__;
- inm_error_set_gerror(INM_MANAGER_ERROR_OPERATION_FAILED, error);
- __INM_FUNC_EXIT__;
- return NULL;
-}
-
-static GVariant *__daemon_get_property(GDBusConnection *connection,
- const gchar *sender,
- const gchar *object_path,
- const gchar *interface_name,
- const gchar *property_name,
- GError **error,
- gpointer user_data)
-{
- GVariant *ret = NULL;
- ret = NULL;
-
- if (g_strcmp0(property_name, "ReadingAlwaysThrowsError") == 0)
- ret = __get_reading_error(sender, error);
-
- return ret;
-}
-
-static inline void __set_writing_error(const gchar *sender,
- const gchar *object_path,
- const gchar *interface_name,
- GVariant *value,
- GError **error)
-{
- __INM_FUNC_ENTER__;
- inm_error_set_gerror(INM_MANAGER_ERROR_NOT_PERMITTED, error);
- __INM_FUNC_EXIT__;
-}
-
-static gboolean __daemon_set_property(GDBusConnection *connection,
- const gchar *sender,
- const gchar *object_path,
- const gchar *interface_name,
- const gchar *property_name,
- GVariant *value,
- GError **error,
- gpointer user_data)
-{
- if (g_strcmp0(property_name, "WritingAlwaysThrowsError") == 0)
- __set_writing_error(sender, object_path, interface_name, value, error);
-
- return *error == NULL;
-}
-
void inm_gdbus_emit_ip_conflicted(int state, gchar *if_name, gchar *ip)
{
GError *error = NULL;
g_variant_builder_unref(builder);
__INM_FUNC_EXIT__;
-
}
void inm_gdbus_emit_conn_ipv4_state_changed(gchar *path, GVariant *signal_args)
__INM_FUNC_EXIT__;
}
-static inline void __handle_get_connected_ap(GVariant *parameters,
- GDBusMethodInvocation *invocation)
-{
- /* TODO get & return real Wi-Fi connected AP */
- GVariant *arg = NULL;
- GVariantBuilder *builder = NULL;
-
- __INM_FUNC_ENTER__;
- builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
- arg = g_variant_new("(a{sv})", builder);
- g_variant_builder_unref(builder);
-
- DEBUG_G_VARIANT("Sending = ", arg);
- g_dbus_method_invocation_return_value(invocation, arg);
- __INM_FUNC_EXIT__;
-}
-
-static inline void __handle_get_found_aps(GVariant *parameters,
- GDBusMethodInvocation *invocation)
-{
- /* TODO get real Wi-Fi Found AP */
- GVariant *arg = NULL;
- GVariantBuilder *builder = NULL;
-
- __INM_FUNC_ENTER__;
- builder = g_variant_builder_new(G_VARIANT_TYPE("a(oa{sv})"));
- arg = g_variant_new("(a(oa{sv}))", builder);
- g_variant_builder_unref(builder);
-
- DEBUG_G_VARIANT("Sending = ", arg);
- g_dbus_method_invocation_return_value(invocation, arg);
- __INM_FUNC_EXIT__;
-}
-
static inline void __handle_get_scan_state(GVariant *parameters,
GDBusMethodInvocation *invocation)
{
GDBusMethodInvocation *invocation,
gpointer user_data)
{
- if (g_strcmp0(method_name, "GetConnectedAp") == 0)
- __handle_get_connected_ap(parameters, invocation);
- else if (g_strcmp0(method_name, "GetFoundAps") == 0)
- __handle_get_found_aps(parameters, invocation);
- else if (g_strcmp0(method_name, "GetScanState") == 0)
+ if (g_strcmp0(method_name, "GetScanState") == 0)
__handle_get_scan_state(parameters, invocation);
}
-static GVariant *__wifi_get_property(GDBusConnection *connection,
- const gchar *sender,
- const gchar *object_path,
- const gchar *interface_name,
- const gchar *property_name,
- GError **error,
- gpointer user_data)
-{
- GVariant *ret;
- ret = NULL;
-
- if (g_strcmp0(property_name, "ReadingAlwaysThrowsError") == 0)
- ret = __get_reading_error(sender, error);
-
- return ret;
-}
-
-static gboolean __wifi_set_property(GDBusConnection *connection,
- const gchar *sender,
- const gchar *object_path,
- const gchar *interface_name,
- const gchar *property_name,
- GVariant *value,
- GError **error,
- gpointer user_data)
-{
- if (g_strcmp0(property_name, "WritingAlwaysThrowsError") == 0)
- __set_writing_error(sender, object_path, interface_name, value, error);
-
- return *error == NULL;
-}
-
static inline void __handle_conn_get_all(gpointer user_data,
GVariant *parameters,
GDBusMethodInvocation *invocation)
GDBusInterfaceVTable __daemon_iface_vtbl = {
__daemon_method_call,
- __daemon_get_property,
- __daemon_set_property};
+ NULL,
+ NULL};
GDBusInterfaceVTable __wifi_iface_vtbl = {
__wifi_method_call,
- __wifi_get_property,
- __wifi_set_property};
+ NULL,
+ NULL};
GDBusInterfaceVTable inm_conn_iface_vtbl = {
__conn_method_call,