Skip to content

Commit 00e8ae8

Browse files
Push 512 instead of 256 bytes, async socket close
1 parent e94641f commit 00e8ae8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/NBClient.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ int NBClient::ready()
165165

166166
case CLIENT_STATE_CLOSE_SOCKET: {
167167

168-
MODEM.sendf("AT+USOCL=%d", _socket);
168+
MODEM.sendf("AT+USOCL=%d,1", _socket);
169169

170170
_state = CLIENT_STATE_WAIT_CLOSE_SOCKET;
171171
ready = 0;
@@ -285,13 +285,13 @@ size_t NBClient::write(const uint8_t* buf, size_t size)
285285
size_t written = 0;
286286
String command;
287287

288-
command.reserve(19 + (size > 256 ? 256 : size) * 2);
288+
command.reserve(19 + (size > 512 ? 512 : size) * 2);
289289

290290
while (size) {
291291
size_t chunkSize = size;
292292

293-
if (chunkSize > 256) {
294-
chunkSize = 256;
293+
if (chunkSize > 512) {
294+
chunkSize = 512;
295295
}
296296

297297
command.reserve(19 + chunkSize * 2);
@@ -436,7 +436,7 @@ void NBClient::stop()
436436
return;
437437
}
438438

439-
MODEM.sendf("AT+USOCL=%d", _socket);
439+
MODEM.sendf("AT+USOCL=%d,1", _socket);
440440
MODEM.waitForResponse(10000);
441441

442442
NBSocketBuffer.close(_socket);
@@ -455,4 +455,4 @@ void NBClient::handleUrc(const String& urc)
455455
}
456456
}
457457
}
458-
}
458+
}

0 commit comments

Comments
 (0)