Commit e91b1c1407aca4d1e9490727c405dd0e67ba8dbb

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

Updating keyboard lock calls.

client/src/core/linux/request.cc
@@ -144,6 +144,51 @@ @@ -144,6 +144,51 @@
144 return *this; 144 return *this;
145 } 145 }
146 146
  147 + static int getUIntValue(DBusMessageIter &iter) {
  148 +
  149 + if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT32) {
  150 +
  151 + dbus_uint32_t rc = 0;
  152 + dbus_message_iter_get_basic(&iter, &rc);
  153 + return (int) rc;
  154 +
  155 + } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT16) {
  156 +
  157 + dbus_uint16_t rc = 0;
  158 + dbus_message_iter_get_basic(&iter, &rc);
  159 + return (int) rc;
  160 +
  161 + } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_VARIANT) {
  162 +
  163 + DBusMessageIter sub;
  164 + int current_type;
  165 +
  166 + dbus_message_iter_recurse(&iter, &sub);
  167 +
  168 + while ((current_type = dbus_message_iter_get_arg_type(&sub)) != DBUS_TYPE_INVALID) {
  169 +
  170 + if (current_type == DBUS_TYPE_UINT32) {
  171 +
  172 + dbus_uint32_t rc = 0;
  173 + dbus_message_iter_get_basic(&sub, &rc);
  174 + return (int) rc;
  175 +
  176 + } else if (current_type == DBUS_TYPE_UINT16) {
  177 + dbus_uint16_t rc = 0;
  178 + dbus_message_iter_get_basic(&sub, &rc);
  179 + return (int) rc;
  180 +
  181 + }
  182 + dbus_message_iter_next(&sub);
  183 + }
  184 +
  185 + }
  186 +
  187 + debug("Argument type is ", ((char) dbus_message_iter_get_arg_type(&iter)) );
  188 + throw std::runtime_error("Expected an integer data type");
  189 +
  190 + }
  191 +
147 static int getIntValue(DBusMessageIter &iter) { 192 static int getIntValue(DBusMessageIter &iter) {
148 193
149 if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_INT32) { 194 if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_INT32) {
@@ -199,6 +244,16 @@ @@ -199,6 +244,16 @@
199 244
200 } 245 }
201 246
  247 + IPC::Request & IPC::Request::Request::pop(unsigned int &value) {
  248 +
  249 + value = getUIntValue(msg.iter);
  250 + dbus_message_iter_next(&msg.iter);
  251 + debug(__FUNCTION__,"= \"",value,"\"");
  252 +
  253 + return *this;
  254 +
  255 + }
  256 +
202 } 257 }
203 258
204 259
client/src/core/session.cc
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 // Wait for unlock, ignore errors. 81 // Wait for unlock, ignore errors.
82 sz = (size_t) (ptr-text); 82 sz = (size_t) (ptr-text);
83 if(sz) { 83 if(sz) {
84 - if( (rc = waitForUnlock()) != 0) { 84 + if( (rc = waitForKeyboardUnlock()) != 0) {
85 return rc; 85 return rc;
86 } 86 }
87 push(text,sz); 87 push(text,sz);
@@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
94 94
95 case 'E': // Enter 95 case 'E': // Enter
96 push(ENTER); 96 push(ENTER);
97 - rc = waitForUnlock(); 97 + rc = waitForKeyboardUnlock();
98 break; 98 break;
99 99
100 case 'F': // Erase EOF 100 case 'F': // Erase EOF
@@ -103,122 +103,122 @@ @@ -103,122 +103,122 @@
103 103
104 case '1': // PF1 104 case '1': // PF1
105 push(PF_1); 105 push(PF_1);
106 - rc = waitForUnlock(); 106 + rc = waitForKeyboardUnlock();
107 break; 107 break;
108 108
109 case '2': // PF2 109 case '2': // PF2
110 push(PF_2); 110 push(PF_2);
111 - rc = waitForUnlock(); 111 + rc = waitForKeyboardUnlock();
112 break; 112 break;
113 113
114 case '3': // PF3 114 case '3': // PF3
115 push(PF_3); 115 push(PF_3);
116 - rc = waitForUnlock(); 116 + rc = waitForKeyboardUnlock();
117 break; 117 break;
118 118
119 case '4': // PF4 119 case '4': // PF4
120 push(PF_4); 120 push(PF_4);
121 - rc = waitForUnlock(); 121 + rc = waitForKeyboardUnlock();
122 break; 122 break;
123 123
124 case '5': // PF5 124 case '5': // PF5
125 push(PF_5); 125 push(PF_5);
126 - rc = waitForUnlock(); 126 + rc = waitForKeyboardUnlock();
127 break; 127 break;
128 128
129 case '6': // PF6 129 case '6': // PF6
130 push(PF_6); 130 push(PF_6);
131 - rc = waitForUnlock(); 131 + rc = waitForKeyboardUnlock();
132 break; 132 break;
133 133
134 case '7': // PF7 134 case '7': // PF7
135 push(PF_7); 135 push(PF_7);
136 - rc = waitForUnlock(); 136 + rc = waitForKeyboardUnlock();
137 break; 137 break;
138 138
139 case '8': // PF8 139 case '8': // PF8
140 push(PF_8); 140 push(PF_8);
141 - rc = waitForUnlock(); 141 + rc = waitForKeyboardUnlock();
142 break; 142 break;
143 143
144 case '9': // PF9 144 case '9': // PF9
145 push(PF_9); 145 push(PF_9);
146 - rc = waitForUnlock(); 146 + rc = waitForKeyboardUnlock();
147 break; 147 break;
148 148
149 case 'a': // PF10 149 case 'a': // PF10
150 push(PF_10); 150 push(PF_10);
151 - rc = waitForUnlock(); 151 + rc = waitForKeyboardUnlock();
152 break; 152 break;
153 153
154 case 'b': // PF11 154 case 'b': // PF11
155 push(PF_11); 155 push(PF_11);
156 - rc = waitForUnlock(); 156 + rc = waitForKeyboardUnlock();
157 break; 157 break;
158 158
159 case 'c': // PF12 159 case 'c': // PF12
160 push(PF_12); 160 push(PF_12);
161 - rc = waitForUnlock(); 161 + rc = waitForKeyboardUnlock();
162 break; 162 break;
163 163
164 case 'd': // PF13 164 case 'd': // PF13
165 push(PF_13); 165 push(PF_13);
166 - rc = waitForUnlock(); 166 + rc = waitForKeyboardUnlock();
167 break; 167 break;
168 168
169 case 'e': // PF14 169 case 'e': // PF14
170 push(PF_14); 170 push(PF_14);
171 - rc = waitForUnlock(); 171 + rc = waitForKeyboardUnlock();
172 break; 172 break;
173 173
174 case 'f': // PF15 174 case 'f': // PF15
175 push(PF_15); 175 push(PF_15);
176 - rc = waitForUnlock(); 176 + rc = waitForKeyboardUnlock();
177 break; 177 break;
178 178
179 case 'g': // PF16 179 case 'g': // PF16
180 push(PF_16); 180 push(PF_16);
181 - rc = waitForUnlock(); 181 + rc = waitForKeyboardUnlock();
182 break; 182 break;
183 183
184 case 'h': // PF17 184 case 'h': // PF17
185 push(PF_17); 185 push(PF_17);
186 - rc = waitForUnlock(); 186 + rc = waitForKeyboardUnlock();
187 break; 187 break;
188 188
189 case 'i': // PF18 189 case 'i': // PF18
190 push(PF_18); 190 push(PF_18);
191 - rc = waitForUnlock(); 191 + rc = waitForKeyboardUnlock();
192 break; 192 break;
193 193
194 case 'j': // PF19 194 case 'j': // PF19
195 push(PF_19); 195 push(PF_19);
196 - rc = waitForUnlock(); 196 + rc = waitForKeyboardUnlock();
197 break; 197 break;
198 198
199 case 'k': // PF20 199 case 'k': // PF20
200 push(PF_20); 200 push(PF_20);
201 - rc = waitForUnlock(); 201 + rc = waitForKeyboardUnlock();
202 break; 202 break;
203 203
204 case 'l': // PF21 204 case 'l': // PF21
205 push(PF_21); 205 push(PF_21);
206 - rc = waitForUnlock(); 206 + rc = waitForKeyboardUnlock();
207 break; 207 break;
208 208
209 case 'm': // PF22 209 case 'm': // PF22
210 push(PF_22); 210 push(PF_22);
211 - rc = waitForUnlock(); 211 + rc = waitForKeyboardUnlock();
212 break; 212 break;
213 213
214 case 'n': // PF23 214 case 'n': // PF23
215 push(PF_23); 215 push(PF_23);
216 - rc = waitForUnlock(); 216 + rc = waitForKeyboardUnlock();
217 break; 217 break;
218 218
219 case 'o': // PF24 219 case 'o': // PF24
220 push(PF_24); 220 push(PF_24);
221 - rc = waitForUnlock(); 221 + rc = waitForKeyboardUnlock();
222 break; 222 break;
223 223
224 case '@': // Send '@' character 224 case '@': // Send '@' character
@@ -227,17 +227,17 @@ @@ -227,17 +227,17 @@
227 227
228 case 'x': // PA1 228 case 'x': // PA1
229 push(PA_1); 229 push(PA_1);
230 - rc = waitForUnlock(); 230 + rc = waitForKeyboardUnlock();
231 break; 231 break;
232 232
233 case 'y': // PA2 233 case 'y': // PA2
234 push(PA_2); 234 push(PA_2);
235 - rc = waitForUnlock(); 235 + rc = waitForKeyboardUnlock();
236 break; 236 break;
237 237
238 case 'z': // PA3 238 case 'z': // PA3
239 push(PA_3); 239 push(PA_3);
240 - rc = waitForUnlock(); 240 + rc = waitForKeyboardUnlock();
241 break; 241 break;
242 242
243 case 'B': // PC_LEFTTAB = "@B" 243 case 'B': // PC_LEFTTAB = "@B"
@@ -356,8 +356,9 @@ @@ -356,8 +356,9 @@
356 356
357 sz = strlen(text); 357 sz = strlen(text);
358 if(sz) { 358 if(sz) {
359 - waitForUnlock();  
360 - push(text,sz); 359 + rc = waitForKeyboardUnlock();
  360 + if(!rc)
  361 + push(text,sz);
361 } 362 }
362 363
363 return rc; 364 return rc;
client/src/core/windows/request.cc
@@ -146,6 +146,33 @@ @@ -146,6 +146,33 @@
146 return *this; 146 return *this;
147 } 147 }
148 148
  149 + IPC::Request & IPC::Request::Request::pop(unsigned int &value) {
  150 +
  151 + DataBlock * block = getNextBlock();
  152 +
  153 + switch(block->type) {
  154 + case IPC::Request::UInt16:
  155 + value = * ((uint16_t *) (block+1));
  156 + in.current += sizeof(uint16_t) + sizeof(DataBlock);
  157 + break;
  158 +
  159 + case IPC::Request::UInt32:
  160 + value = * ((uint32_t *) (block+1));
  161 + in.current += sizeof(uint32_t) + sizeof(DataBlock);
  162 + break;
  163 +
  164 + case IPC::Request::UInt64:
  165 + value = * ((uint64_t *) (block+1));
  166 + in.current += sizeof(uint64_t) + sizeof(DataBlock);
  167 + break;
  168 +
  169 + default:
  170 + throw std::runtime_error("Invalid format");
  171 + }
  172 +
  173 + return *this;
  174 + }
  175 +
149 IPC::Request & IPC::Request::call() { 176 IPC::Request & IPC::Request::call() {
150 177
151 #ifdef DEBUG 178 #ifdef DEBUG
client/src/host/actions.cc
@@ -55,8 +55,8 @@ TN3270::Host & TN3270::Host::waitForReady(time_t timeout) { @@ -55,8 +55,8 @@ TN3270::Host & TN3270::Host::waitForReady(time_t timeout) {
55 return *this; 55 return *this;
56 } 56 }
57 57
58 -TN3270::Host & TN3270::Host::waitForUnlock(time_t timeout) {  
59 - this->session->waitForUnlock(timeout); 58 +TN3270::Host & TN3270::Host::waitForKeyboardUnlock(time_t timeout) {
  59 + this->session->waitForKeyboardUnlock(timeout);
60 return *this; 60 return *this;
61 } 61 }
62 62
client/src/include/ipc-client-internals.h
@@ -258,6 +258,7 @@ @@ -258,6 +258,7 @@
258 // Pop values 258 // Pop values
259 Request & pop(std::string &value); 259 Request & pop(std::string &value);
260 Request & pop(int &value); 260 Request & pop(int &value);
  261 + Request & pop(unsigned int &value);
261 262
262 }; 263 };
263 264
client/src/session/local/actions.cc
@@ -73,10 +73,10 @@ @@ -73,10 +73,10 @@
73 chkResponse(lib3270_wait_for_ready(this->hSession, timeout)); 73 chkResponse(lib3270_wait_for_ready(this->hSession, timeout));
74 } 74 }
75 75
76 - LIB3270_KEYBOARD_LOCK_STATE Local::Session::waitForUnlock(time_t timeout) const { 76 + LIB3270_KEYBOARD_LOCK_STATE Local::Session::waitForKeyboardUnlock(time_t timeout) const {
77 77
78 std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync); 78 std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync);
79 - return lib3270_wait_for_unlock(this->hSession, timeout); 79 + return lib3270_wait_for_keyboard_unlock(this->hSession, timeout);
80 } 80 }
81 81
82 void Local::Session::waitForChange(time_t seconds) const { 82 void Local::Session::waitForChange(time_t seconds) const {
client/src/session/local/get.cc
@@ -103,6 +103,11 @@ @@ -103,6 +103,11 @@
103 103
104 } 104 }
105 105
  106 + LIB3270_KEYBOARD_LOCK_STATE Local::Session::getKeyboardUnlock() const {
  107 + std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync);
  108 + return lib3270_get_keyboard_lock_state(hSession);
  109 + }
  110 +
106 111
107 } 112 }
108 113
client/src/session/local/private.h
@@ -103,7 +103,7 @@ @@ -103,7 +103,7 @@
103 void wait(time_t seconds) const override; 103 void wait(time_t seconds) const override;
104 void waitForReady(time_t timeout) const override; 104 void waitForReady(time_t timeout) const override;
105 void waitForChange(time_t timeout) const override; 105 void waitForChange(time_t timeout) const override;
106 - LIB3270_KEYBOARD_LOCK_STATE waitForUnlock(time_t seconds) const override; 106 + LIB3270_KEYBOARD_LOCK_STATE waitForKeyboardUnlock(time_t seconds) const override;
107 107
108 // States 108 // States
109 ProgramMessage getProgramMessage() const override; 109 ProgramMessage getProgramMessage() const override;
@@ -112,6 +112,7 @@ @@ -112,6 +112,7 @@
112 112
113 // Properties. 113 // Properties.
114 void getProperty(const char *name, int &value) const override; 114 void getProperty(const char *name, int &value) const override;
  115 + void getProperty(const char *name, unsigned int &value) const override;
115 void getProperty(const char *name, std::string &value) const override; 116 void getProperty(const char *name, std::string &value) const override;
116 void getProperty(const char *name, bool &value) const override; 117 void getProperty(const char *name, bool &value) const override;
117 void setProperty(const char *name, const int value) override; 118 void setProperty(const char *name, const int value) override;
@@ -120,6 +121,7 @@ @@ -120,6 +121,7 @@
120 std::string getVersion() const override; 121 std::string getVersion() const override;
121 std::string getRevision() const override; 122 std::string getRevision() const override;
122 std::string getLUName() const override; 123 std::string getLUName() const override;
  124 + LIB3270_KEYBOARD_LOCK_STATE getKeyboardUnlock() const override;
123 125
124 std::string getHostURL() const override; 126 std::string getHostURL() const override;
125 void setHostURL(const char *url) override; 127 void setHostURL(const char *url) override;
client/src/session/local/properties.cc
@@ -68,6 +68,29 @@ @@ -68,6 +68,29 @@
68 throw std::system_error(ENOENT, std::system_category()); 68 throw std::system_error(ENOENT, std::system_category());
69 } 69 }
70 70
  71 + void Local::Session::getProperty(const char *name, unsigned int &value) const {
  72 +
  73 + const LIB3270_UINT_PROPERTY * intprop = lib3270_get_unsigned_properties_list();
  74 + for(size_t ix = 0; intprop[ix].name; ix++) {
  75 +
  76 + if(!strcasecmp(name,intprop[ix].name)) {
  77 +
  78 + std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync);
  79 +
  80 + value = intprop[ix].get(hSession);
  81 +
  82 + if(value < 0 && errno != 0) {
  83 + throw std::system_error(errno, std::system_category());
  84 + }
  85 +
  86 +
  87 + }
  88 +
  89 + }
  90 +
  91 + throw std::system_error(ENOENT, std::system_category());
  92 + }
  93 +
71 void Local::Session::getProperty(const char *name, std::string &value) const { 94 void Local::Session::getProperty(const char *name, std::string &value) const {
72 95
73 const LIB3270_STRING_PROPERTY * strprop = lib3270_get_string_properties_list(); 96 const LIB3270_STRING_PROPERTY * strprop = lib3270_get_string_properties_list();
client/src/session/remote/actions.cc
@@ -128,7 +128,7 @@ @@ -128,7 +128,7 @@
128 128
129 } 129 }
130 130
131 - LIB3270_KEYBOARD_LOCK_STATE IPC::Session::waitForUnlock(time_t timeout) const { 131 + LIB3270_KEYBOARD_LOCK_STATE IPC::Session::waitForKeyboardUnlock(time_t timeout) const {
132 132
133 int rc; 133 int rc;
134 134
@@ -136,9 +136,9 @@ @@ -136,9 +136,9 @@
136 136
137 while(time(nullptr) < end) { 137 while(time(nullptr) < end) {
138 138
139 - debug("Running waitForUnlock request..."); 139 + debug("Running waitForKeyboardUnlock request...");
140 140
141 - Request(*this,"waitForUnlock") 141 + Request(*this,"waitForKeyboardUnlock")
142 .push((uint32_t) 1) 142 .push((uint32_t) 1)
143 .call() 143 .call()
144 .pop(rc); 144 .pop(rc);
client/src/session/remote/get.cc
@@ -109,6 +109,12 @@ @@ -109,6 +109,12 @@
109 109
110 } 110 }
111 111
  112 + LIB3270_KEYBOARD_LOCK_STATE IPC::Session::getKeyboardUnlock() const {
  113 + unsigned int value;
  114 + getProperty("kybdlock",value);
  115 + return (LIB3270_KEYBOARD_LOCK_STATE) value;
  116 + }
  117 +
112 118
113 } 119 }
114 120
client/src/session/remote/private.h
@@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@
101 void wait(time_t seconds) const override; 101 void wait(time_t seconds) const override;
102 void waitForReady(time_t timeout) const override; 102 void waitForReady(time_t timeout) const override;
103 void waitForChange(time_t timeout) const override; 103 void waitForChange(time_t timeout) const override;
104 - LIB3270_KEYBOARD_LOCK_STATE waitForUnlock(time_t seconds) const override; 104 + LIB3270_KEYBOARD_LOCK_STATE waitForKeyboardUnlock(time_t seconds) const override;
105 105
106 // States 106 // States
107 ProgramMessage getProgramMessage() const override; 107 ProgramMessage getProgramMessage() const override;
@@ -110,6 +110,7 @@ @@ -110,6 +110,7 @@
110 110
111 // Properties. 111 // Properties.
112 void getProperty(const char *name, int &value) const override; 112 void getProperty(const char *name, int &value) const override;
  113 + void getProperty(const char *name, unsigned int &value) const override;
113 void getProperty(const char *name, std::string &value) const override; 114 void getProperty(const char *name, std::string &value) const override;
114 void getProperty(const char *name, bool &value) const override; 115 void getProperty(const char *name, bool &value) const override;
115 void setProperty(const char *name, const int value) override; 116 void setProperty(const char *name, const int value) override;
@@ -118,6 +119,7 @@ @@ -118,6 +119,7 @@
118 std::string getVersion() const override; 119 std::string getVersion() const override;
119 std::string getRevision() const override; 120 std::string getRevision() const override;
120 std::string getLUName() const override; 121 std::string getLUName() const override;
  122 + LIB3270_KEYBOARD_LOCK_STATE getKeyboardUnlock() const override;
121 123
122 std::string getHostURL() const override; 124 std::string getHostURL() const override;
123 void setHostURL(const char *url) override; 125 void setHostURL(const char *url) override;
client/src/session/remote/properties.cc
@@ -53,6 +53,14 @@ @@ -53,6 +53,14 @@
53 53
54 } 54 }
55 55
  56 + void IPC::Session::getProperty(const char *name, unsigned int &value) const {
  57 +
  58 + Request(*this,false,name)
  59 + .call()
  60 + .pop(value);
  61 +
  62 + }
  63 +
56 void IPC::Session::getProperty(const char *name, std::string &value) const { 64 void IPC::Session::getProperty(const char *name, std::string &value) const {
57 65
58 Request(*this,false,name) 66 Request(*this,false,name)
client/src/testprogram/testprogram.cc
@@ -99,7 +99,7 @@ @@ -99,7 +99,7 @@
99 host.connect(nullptr); 99 host.connect(nullptr);
100 100
101 cout 101 cout
102 - << "Wait for unlock returns " << host.waitForUnlock() << std::endl 102 + << "Wait for unlock returns " << host.getKeyboardUnlock() << std::endl
103 << "Connection state is " << toCharString(host.getConnectionState()) << std::endl 103 << "Connection state is " << toCharString(host.getConnectionState()) << std::endl
104 << "Program message is " << toCharString(host.getProgramMessage()) << std::endl 104 << "Program message is " << toCharString(host.getProgramMessage()) << std::endl
105 << "Luname is " << host.getLUName() << std::endl 105 << "Luname is " << host.getLUName() << std::endl
common/src/include/lib3270/ipc.h
@@ -288,6 +288,7 @@ @@ -288,6 +288,7 @@
288 288
289 // Properties. 289 // Properties.
290 virtual void getProperty(const char *name, int &value) const = 0; 290 virtual void getProperty(const char *name, int &value) const = 0;
  291 + virtual void getProperty(const char *name, unsigned int &value) const = 0;
291 virtual void getProperty(const char *name, std::string &value) const = 0; 292 virtual void getProperty(const char *name, std::string &value) const = 0;
292 virtual void getProperty(const char *name, bool &value) const = 0; 293 virtual void getProperty(const char *name, bool &value) const = 0;
293 virtual void setProperty(const char *name, const int value) = 0; 294 virtual void setProperty(const char *name, const int value) = 0;
@@ -296,6 +297,7 @@ @@ -296,6 +297,7 @@
296 virtual std::string getVersion() const = 0; 297 virtual std::string getVersion() const = 0;
297 virtual std::string getRevision() const = 0; 298 virtual std::string getRevision() const = 0;
298 virtual std::string getLUName() const = 0; 299 virtual std::string getLUName() const = 0;
  300 + virtual LIB3270_KEYBOARD_LOCK_STATE getKeyboardUnlock() const = 0;
299 301
300 virtual std::string getHostURL() const = 0; 302 virtual std::string getHostURL() const = 0;
301 virtual void setHostURL(const char *url) = 0; 303 virtual void setHostURL(const char *url) = 0;
@@ -337,7 +339,7 @@ @@ -337,7 +339,7 @@
337 virtual void waitForChange(time_t seconds = DEFAULT_TIMEOUT) const = 0; 339 virtual void waitForChange(time_t seconds = DEFAULT_TIMEOUT) const = 0;
338 340
339 /// @brief Wait for screen changes. 341 /// @brief Wait for screen changes.
340 - virtual LIB3270_KEYBOARD_LOCK_STATE waitForUnlock(time_t seconds = DEFAULT_TIMEOUT) const = 0; 342 + virtual LIB3270_KEYBOARD_LOCK_STATE waitForKeyboardUnlock(time_t seconds = DEFAULT_TIMEOUT) const = 0;
341 343
342 /// @brief Send PF. 344 /// @brief Send PF.
343 virtual void pfkey(unsigned short value) = 0; 345 virtual void pfkey(unsigned short value) = 0;
@@ -424,8 +426,8 @@ @@ -424,8 +426,8 @@
424 426
425 template<typename T> 427 template<typename T>
426 Host & push(T value) { 428 Host & push(T value) {
427 - session->push(value);  
428 sync(); 429 sync();
  430 + session->push(value);
429 return *this; 431 return *this;
430 } 432 }
431 433
@@ -440,7 +442,7 @@ @@ -440,7 +442,7 @@
440 Host & connect(const char *url = nullptr); 442 Host & connect(const char *url = nullptr);
441 Host & disconnect(); 443 Host & disconnect();
442 Host & waitForReady(time_t timeout = DEFAULT_TIMEOUT); 444 Host & waitForReady(time_t timeout = DEFAULT_TIMEOUT);
443 - Host & waitForUnlock(time_t timeout = DEFAULT_TIMEOUT); 445 + Host & waitForKeyboardUnlock(time_t timeout = DEFAULT_TIMEOUT);
444 446
445 /// @brief Execute action by name. 447 /// @brief Execute action by name.
446 inline Host & action(const char *action_name) { 448 inline Host & action(const char *action_name) {
@@ -511,6 +513,10 @@ @@ -511,6 +513,10 @@
511 return session->getLUName(); 513 return session->getLUName();
512 } 514 }
513 515
  516 + inline LIB3270_KEYBOARD_LOCK_STATE getKeyboardUnlock() const {
  517 + return session->getKeyboardUnlock();
  518 + }
  519 +
514 // Actions 520 // Actions
515 521
516 /// @brief Send PF. 522 /// @brief Send PF.
server/src/core/linux/gobject.c
@@ -155,7 +155,7 @@ void ipc3270_add_terminal_introspection(GString *introspection) { @@ -155,7 +155,7 @@ void ipc3270_add_terminal_introspection(GString *introspection) {
155 " <arg type='u' name='seconds' direction='in' />" \ 155 " <arg type='u' name='seconds' direction='in' />" \
156 " <arg type='i' name='result' direction='out' />" \ 156 " <arg type='i' name='result' direction='out' />" \
157 " </method>" \ 157 " </method>" \
158 - " <method name= 'waitForUnlock'>" \ 158 + " <method name= 'waitForKeyboardUnlock'>" \
159 " <arg type='u' name='seconds' direction='in' />" \ 159 " <arg type='u' name='seconds' direction='in' />" \
160 " <arg type='i' name='result' direction='out' />" \ 160 " <arg type='i' name='result' direction='out' />" \
161 " </method>" \ 161 " </method>" \
server/src/core/methods/methods.c
@@ -46,22 +46,22 @@ int ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *req @@ -46,22 +46,22 @@ int ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *req
46 { "connect", ipc3270_method_connect }, 46 { "connect", ipc3270_method_connect },
47 { "disconnect", ipc3270_method_disconnect }, 47 { "disconnect", ipc3270_method_disconnect },
48 48
49 - { "wait", ipc3270_method_wait },  
50 - { "waitforready", ipc3270_method_wait_for_ready },  
51 - { "waitforupdate", ipc3270_method_wait_for_update },  
52 - { "waitforunlock", ipc3270_method_wait_for_unlock },  
53 -  
54 - { "getString", ipc3270_method_get_string },  
55 - { "getStringAt", ipc3270_method_get_string },  
56 - { "getStringAtAddress", ipc3270_method_get_string },  
57 -  
58 - { "setString", ipc3270_method_set_string },  
59 - { "setStringAt", ipc3270_method_set_string },  
60 - { "setStringAtAddress", ipc3270_method_set_string },  
61 -  
62 - { "getFieldAttribute", ipc3270_method_get_field_attribute },  
63 - { "getFieldAttributeAt", ipc3270_method_get_field_attribute },  
64 - { "getFieldAttributeAtAddress", ipc3270_method_get_field_attribute }, 49 + { "wait", ipc3270_method_wait },
  50 + { "waitforready", ipc3270_method_wait_for_ready },
  51 + { "waitforupdate", ipc3270_method_wait_for_update },
  52 + { "waitforkeyboardunlock", ipc3270_method_wait_for_keyboard_unlock },
  53 +
  54 + { "getString", ipc3270_method_get_string },
  55 + { "getStringAt", ipc3270_method_get_string },
  56 + { "getStringAtAddress", ipc3270_method_get_string },
  57 +
  58 + { "setString", ipc3270_method_set_string },
  59 + { "setStringAt", ipc3270_method_set_string },
  60 + { "setStringAtAddress", ipc3270_method_set_string },
  61 +
  62 + { "getFieldAttribute", ipc3270_method_get_field_attribute },
  63 + { "getFieldAttributeAt", ipc3270_method_get_field_attribute },
  64 + { "getFieldAttributeAtAddress", ipc3270_method_get_field_attribute },
65 65
66 }; 66 };
67 67
server/src/core/methods/private.h
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 G_GNUC_INTERNAL int ipc3270_method_wait(GObject *session, GVariant *request, GObject *response, GError **error); 50 G_GNUC_INTERNAL int ipc3270_method_wait(GObject *session, GVariant *request, GObject *response, GError **error);
51 G_GNUC_INTERNAL int ipc3270_method_wait_for_ready(GObject *session, GVariant *request, GObject *response, GError **error); 51 G_GNUC_INTERNAL int ipc3270_method_wait_for_ready(GObject *session, GVariant *request, GObject *response, GError **error);
52 G_GNUC_INTERNAL int ipc3270_method_wait_for_update(GObject *session, GVariant *request, GObject *response, GError **error); 52 G_GNUC_INTERNAL int ipc3270_method_wait_for_update(GObject *session, GVariant *request, GObject *response, GError **error);
53 - G_GNUC_INTERNAL int ipc3270_method_wait_for_unlock(GObject *session, GVariant *request, GObject *response, GError **error); 53 + G_GNUC_INTERNAL int ipc3270_method_wait_for_keyboard_unlock(GObject *session, GVariant *request, GObject *response, GError **error);
54 54
55 G_GNUC_INTERNAL int ipc3270_method_get_field_attribute(GObject *session, GVariant *request, GObject *response, GError **error); 55 G_GNUC_INTERNAL int ipc3270_method_get_field_attribute(GObject *session, GVariant *request, GObject *response, GError **error);
56 56
server/src/core/methods/wait.c
@@ -57,11 +57,11 @@ int ipc3270_method_wait_for_update(GObject *session, GVariant *request, GObject @@ -57,11 +57,11 @@ int ipc3270_method_wait_for_update(GObject *session, GVariant *request, GObject
57 57
58 } 58 }
59 59
60 -int ipc3270_method_wait_for_unlock(GObject *session, GVariant *request, GObject *response, GError G_GNUC_UNUSED(**error)) { 60 +int ipc3270_method_wait_for_keyboard_unlock(GObject *session, GVariant *request, GObject *response, GError G_GNUC_UNUSED(**error)) {
61 61
62 guint seconds = 1; 62 guint seconds = 1;
63 g_variant_get(request, "(u)", &seconds); 63 g_variant_get(request, "(u)", &seconds);
64 - ipc3270_response_append_int32(response, (int32_t) lib3270_wait_for_unlock(ipc3270_get_session(session),seconds)); 64 + ipc3270_response_append_int32(response, (int32_t) lib3270_wait_for_keyboard_unlock(ipc3270_get_session(session),seconds));
65 return 0; 65 return 0;
66 66
67 } 67 }