Commit e78a756026906929648588cf0e267c9543a5bb2e

Authored by Perry Werneck
1 parent cb2701ab
Exists in master and in 1 other branch develop

Working on IPC module.

Showing 2 changed files with 14 additions and 1 deletions   Show diff stats
src/core/linux/gobject.c
... ... @@ -128,6 +128,9 @@ void ipc3270_add_terminal_introspection(GString *introspection) {
128 128 " <arg type='y' name='lf' direction='in' />" \
129 129 " <arg type='s' name='text' direction='out' />" \
130 130 " </method>" \
  131 + " <method name= 'waitForReady'>" \
  132 + " <arg type='i' name='seconds' direction='in' />" \
  133 + " </method>" \
131 134 " <property type='s' name='version' access='read'/>" \
132 135 " <property type='s' name='revision' access='read'/>"
133 136 );
... ...
src/core/methods.c
... ... @@ -42,7 +42,8 @@
42 42 // #include <dbus/dbus-glib.h>
43 43 // #include <dbus/dbus-glib-bindings.h>
44 44  
45   -GVariant * ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *parameters, GError **error) {
  45 +GVariant * ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *parameters, GError **error)
  46 +{
46 47  
47 48 size_t ix;
48 49 H3270 * hSession = ipc3270_get_session(object);
... ... @@ -128,6 +129,13 @@ GVariant * ipc3270_method_call(GObject *object, const gchar *method_name, GVaria
128 129 return ipc3270_GVariant_from_input_string(object,lib3270_get_string_at_address(hSession, addr, len, lf),error);
129 130  
130 131 }
  132 + else if(!g_ascii_strcasecmp(method_name,"waitforready"))
  133 + {
  134 + gint timeout = 1;
  135 + g_variant_get(parameters, "(i)", &timeout);
  136 + return g_variant_new("(i)", (gint) lib3270_wait_for_ready(hSession,timeout));
  137 + }
  138 +
131 139 // Check action table.
132 140 const LIB3270_ACTION_ENTRY * actions = lib3270_get_action_table();
133 141 for(ix = 0; actions[ix].name; ix++)
... ... @@ -173,6 +181,8 @@ GVariant * ipc3270_method_call(GObject *object, const gchar *method_name, GVaria
173 181  
174 182 }
175 183  
  184 + g_message("Unknown method \"%s\"",method_name);
  185 +
176 186 return NULL;
177 187  
178 188 }
... ...