Set command

The set command registers or unregisters an SMS client. Only one AT client can be registered as an SMS client. An existing registration must be released before registering a new client.

Syntax:

+CNMI=[<mode>[,<mt>[,<bm>[,<ds>]]]]
+CMS ERROR code
301 – SMS service of ME reserved.
302 – Not allowed.

The set command parameters and their defined values are the following:

<mode>
0 – Unsubscribe unsolicited result codes.
3 – Subscribe unsolicited result codes.
<mt>
0 – No received message notifications, the modem acts as an SMS client. Forces also <ds> to 0.
2 – SMS-DELIVERs (except class 2 and message waiting indication group) are routed directly to the TE using unsolicited result code +CMT: [<alpha>],<length><CR><LF><pdu>. TE needs to ACK with +CNMA.
<bm>
Ignored
<ds>
0 – No SMS-STATUS-REPORTs are routed to the TE. The only option if <mt> is set to 0.
1 – SMS-STATUS-REPORTs are routed to the TE using unsolicited result code: +CDS: <length><CR><LF><pdu>. TE needs to ACK with +CNMA.

The TE needs to handle both SMS-DELIVER and SMS-STATUS-REPORT or neither of them, <mt> and <ds> shall both be set to 0 at the same time, equals to <mode> 0.

The following command example registers as a client for mobile-terminated SMS and status reports:

AT+CNMI=3,2,0,1
OK