Skip to content

Commit 22951d7

Browse files
authored
Merge pull request #11616 from u-blox/ubx_cellular_api
Cellular: Setting timeout before send command in gethostbyname.
2 parents 319fd67 + b2d0448 commit 22951d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,14 @@ nsapi_error_t UBLOX_AT_CellularStack::gethostbyname(const char *host, SocketAddr
447447
if (address->set_ip_address(host)) {
448448
err = NSAPI_ERROR_OK;
449449
} else {
450-
// This interrogation can sometimes take longer than the usual 8 seconds
451-
_at.cmd_start_stop("+UDNSRN", "=0,", "%s", host);
452450
#ifdef TARGET_UBLOX_C030_R41XM
453451
_at.set_at_timeout(70000);
454452
#else
455453
_at.set_at_timeout(120000);
456454
#endif
455+
// This interrogation can sometimes take longer than the usual 8 seconds
456+
_at.cmd_start_stop("+UDNSRN", "=0,", "%s", host);
457+
457458
_at.resp_start("+UDNSRN:");
458459
if (_at.info_resp()) {
459460
_at.read_string(ipAddress, sizeof(ipAddress));

0 commit comments

Comments
 (0)