Skip to content

app: Remove extra <CRLF> from AT response#182

Closed
trantanen wants to merge 1 commit into
nrfconnect:mainfrom
trantanen:at_resp_crlf
Closed

app: Remove extra <CRLF> from AT response#182
trantanen wants to merge 1 commit into
nrfconnect:mainfrom
trantanen:at_resp_crlf

Conversation

@trantanen
Copy link
Copy Markdown
Collaborator

@trantanen trantanen commented Feb 13, 2026

SM used to add <CRLF> between information text and the OK in AT responses when MFW returns one <CRLF> in there as follows:
<CRLF>+COMMAND: RESPONSE,VALUE,OR,TEXT<CRLF><CRLF>OK<CRLF>

Two <CRLF>s before OK will change to one:
<CRLF>+COMMAND: RESPONSE,VALUE,OR,TEXT<CRLF>OK<CRLF>

This should be aligned with 3GPP TS 27.007 Section 4.2.

@junqingzou
Copy link
Copy Markdown

image

SM used to add <CRLF> between information text and the OK in
AT responses when MFW returns one <CRLF> in there as follows:
<CRLF>+COMMAND: RESPONSE,VALUE,OR,TEXT<CRLF><CRLF>OK<CRLF>

Two <CRLF>s before OK will change to one:
<CRLF>+COMMAND: RESPONSE,VALUE,OR,TEXT<CRLF>OK<CRLF>

This should be aligned with 3GPP TS 27.007 Section 4.2.

Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
Comment thread app/src/sm_at_host.c
if (err) {
LOG_ERR("AT command response failed: %d", err);
}
err = sm_at_send_str(buf);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works well for the AT+ and AT%, but the SM AT# commands still send the additional \r\n:

OK
Ready
at#xsocket=1,1,0

#XSOCKET: 0,1,6

OK
at+cereg?

+CEREG: 0,4
OK

The first \r\n comes from:
https://github.com/nrfconnect/ncs-serial-modem/blob/main/app/src/sm_at_socket.c#L542

And the second one from lines above this. The first one should be removed from all the commands.

@trantanen trantanen marked this pull request as draft February 13, 2026 13:17
@trantanen
Copy link
Copy Markdown
Collaborator Author

image

I've looked at this and I guess there is some room for interpretation. The same standard doesn't have double line break in informative examples. But they are informative.
It seems double line break is something that are used elsewhere too.
I guess I'll just close this PR. Given also how much this would affect on SM specific AT commands.

@trantanen
Copy link
Copy Markdown
Collaborator Author

It seems double CRLF before OK is done for specific requests from customers so we won't change it.

@trantanen trantanen closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants