How to send " (0x22) over UDP through AT#XUDPSEND in SLM > v1.7

Hi!

In previous versions of the SLM it was possible to provide a hex datatype to the XUDPSEND command to send blobs of data over UDP, without having to worry about a stray " value in your data. In the newer versions of the SLM this seems to be removed, and you either have to opt for regular data or data-mode. We tried both, and are failing to make it work. We've tried the following:

  1. Escaping the double quotes in the regular AT command as below. This did not work. The SLM-application does not send any data and does not respond back with an error or acknowledgement.
    AT#XUDPSEND="Can \"we\" escape this?"\r\n
  2. Using SLM-datamode. We've tried both with and without an equals sign, both error when any data is send after the first CR LF. The modem responds with "\r\nERROR\r\n". Whenever we send eg. AT#XUDPSEND="test"\r\n, the modem responds fine with the amount of bytes transferred, so we think the error is related to our use of the data-mode?
    AT#XUDPSEND\r\nThis is a test+++\r\n 
    AT#XUDPSEND=\r\nThis is a test+++\r\n

Would be great if you guys could give us any insight on this issue, as we'd like to upgrade our application to a recent SLM to enjoy some of the new features.

  • Ivan Herrera said:
    It seems that data-mode isn't even entered?

    Without having checked the code to see if my assumption is correct, it sounds like the SLM isn't splitting on the \r\n, and takes the whole string as a command.

    Ivan Herrera said:
    We also note that the exit sequence (+++) is being transmitted, and the device does not exit data-mode

    The exit sequence must be sent without any line endings. I.e. there is a difference between "+++" and "+++\r\n". The first should get you out of data mode, the second one will not.

    Ivan Herrera said:
    Additional question: in NCS 1.6, the CONFIG_SLM_DATAMODE_SILENCE parameter is defined in the SLM app documentation, but it has disappeared on the documentation in NCS 1.9. Is this configuration option still valid?

    No, that option no longer exist.

  • Hi Didrik!

    When upgrading from SLM 1.8.99 to SLM v1.9.1 the first issue disappeared. The second issue with it not exiting data-mode also was resolved when exclusively sending +++ without any CR LF. 

    Regarding the silence period, there still seems to be a small pause required around the "+++" send but sleeping for 1ms does the trick for us so this is more than acceptable in our use case.

    Thank you for your support!

Related