Commit 3138caa8ea9d5987f38f82ceaeba219f23ce2144

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

Fixing bug on response parser.

client/src/core/linux/request.cc
... ... @@ -302,6 +302,17 @@
302 302 dbus_message_iter_get_basic(&iter, &rc);
303 303 return (int) rc;
304 304  
  305 + } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT32) {
  306 +
  307 + dbus_uint32_t rc = 0;
  308 + dbus_message_iter_get_basic(&iter, &rc);
  309 + return (int) rc;
  310 +
  311 + } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_INVALID) {
  312 +
  313 + debug("Argument type is invalid");
  314 + throw std::runtime_error("Invalid data type");
  315 +
305 316 } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_VARIANT) {
306 317  
307 318 DBusMessageIter sub;
... ... @@ -319,6 +330,12 @@
319 330 dbus_message_iter_get_basic(&sub, &rc);
320 331 return (int) rc;
321 332  
  333 + } else if (current_type == DBUS_TYPE_UINT32) {
  334 +
  335 + dbus_uint32_t rc = 0;
  336 + dbus_message_iter_get_basic(&sub, &rc);
  337 + return (int) rc;
  338 +
322 339 } else if (current_type == DBUS_TYPE_INT16) {
323 340 dbus_int16_t rc = 0;
324 341 dbus_message_iter_get_basic(&sub, &rc);
... ...
client/src/session/remote/properties.cc
... ... @@ -133,7 +133,18 @@
133 133 }
134 134  
135 135 void IPC::Session::setUnlockDelay(unsigned short delay) {
136   - setAttribute("unlock_delay", (uint32_t) delay);
  136 +
  137 + int32_t rc = -1;
  138 +
  139 + Request(*this,true,"unlock_delay")
  140 + .push((uint32_t) delay)
  141 + .call()
  142 + .pop(rc);
  143 +
  144 + if(rc) {
  145 + throw std::system_error((int) rc, std::system_category());
  146 + }
  147 +
137 148 }
138 149  
139 150 void IPC::Session::setLockOnOperatorError(bool lock) {
... ...
client/src/testprogram/testprogram.cc
... ... @@ -131,6 +131,8 @@
131 131 << "\tConnected: " << host["Connected"]
132 132 << std::endl;
133 133  
  134 + host.setUnlockDelay(0);
  135 + host.setTimeout(10);
134 136 host.connect(nullptr);
135 137  
136 138 cout
... ...
server/testscripts/introspect.sh
1 1 #!/bin/bash
  2 +
  3 +PRODUCT_NAME=$(pkg-config --variable=product_name lib3270)
  4 +
2 5 gdbus \
3 6 introspect \
4 7 --session \
5   - --dest=br.com.bb.$(pkg-config --variable=product_name lib3270).a \
6   - --object-path=/br/com/bb/tn3270/session
  8 + --dest=br.com.bb.${PRODUCT_NAME}.a \
  9 + --object-path=/br/com/bb/${PRODUCT_NAME}/a
7 10  
... ...