Skip to content

Commit 30040ea

Browse files
authored
Merge pull request #26 from sparkfun/release_candidate
v1.1.5
2 parents 4bb5a33 + 6563fba commit 30040ea

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun u-blox SARA-R5 Arduino Library
2-
version=1.1.4
2+
version=1.1.5
33
author=SparkFun Electronics <[email protected]>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for the u-blox SARA-R5 LTE-M / NB-IoT modules with secure cloud<br/><br/>

src/SparkFun_u-blox_SARA-R5_Arduino_Library.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -2507,7 +2507,10 @@ SARA_R5_error_t SARA_R5::socketClose(int socket, unsigned long timeout)
25072507
free(command);
25082508
return SARA_R5_ERROR_OUT_OF_MEMORY;
25092509
}
2510-
sprintf(command, "%s=%d", SARA_R5_CLOSE_SOCKET, socket);
2510+
// if timeout is short, close asynchronously and don't wait for socket closure (we will get the URC later)
2511+
// this will make sure the AT command parser is not confused during init()
2512+
const char* format = (SARA_R5_STANDARD_RESPONSE_TIMEOUT == timeout) ? "%s=%d,1" : "%s=%d";
2513+
sprintf(command, format, SARA_R5_CLOSE_SOCKET, socket);
25112514

25122515
err = sendCommandWithResponse(command, SARA_R5_RESPONSE_OK_OR_ERROR, response, timeout);
25132516

0 commit comments

Comments
 (0)