Hard coded context ID of 0 in the Serial LTE Modem application (nRF SDK 2.0.0)

Hi!

I am using the Serial LTE Modem application from the nRF Connect SDK v.2.0.0

In the source code for this app, every call to: 

int util_resolve_host(int cid, const char *host, uint16_t port, int family, struct sockaddr *sa)
has a hardcoded "cid" argument with the value 0. This is a problem where a preexisting default context can't be used. It isn't possible to deactivate the default context and any new context will have a non zero id.
Creating a new context with AT+CGDCONT, activating the this context and deactivating the default with AT+CGACT will result in a single remaining context with a cid of 1.
Attempting to use AT#XSENDTO with an active context with cid=1 will result in a call to util_resolve_host with a hard coded cid=0 and the AT command will fail.
I can always hard code a different cid and recompile the application, but somehow this feels like the wrong solution to the problem Slight smile
Any suggestions to how I can get around this using AT commands without having to patch the SLM source code ?
Regards
Hans Jørgen
Lab5e AS
Parents Reply Children
No Data
Related