Hello everyone,
I'm trying to get an Unsolicited Response Code (URC) from the SARA-U201 module, in string form for taking out some pieces of information.
Using the <MKRGSM.h> library we can use MODEM.send([AT command]) to send the SARA-U201 module the needed AT commands. And using MODEM.waitForResponse() we could get the direct response from the module as in the next example:
String imei;
MODEM.send("AT+CGSN");
MODEM.waitForResponse(1000, &imei);
Serial.println("IMEI: " + imei);
Getting the IMEI number from the module.
Now, some AT commands has URCs as second response (being the first one "OK") and may take some time to get them. For example: AT+ULOC, "If <response_type>=0", has an URC as follows:
+UULOC: <date>,<time>,<lat>,<long>,<alt>,<uncertainty>
MODEM.waitForResponse() doesn't get the URCs and I need to get the URC as a String variable to stract the longitude and latitude.
The GSMLocation class, from the <MKRGSM.h> library, already have a function for handling with URCs by his own means and functions for getting the longitude and latitude, but it's necessary to perform the GSMLocation.available() function before, and I don't want to use the programmed AT command:
MODEM.send("AT+ULOC=2,2,0,1,1");
because it's 'timeout' is set for 1 second and I need at least 60 seconds for my project.
Can someone, please, tell me how to get the URC as a String variable if I use the +ULOC command?