.. _SM_AT_SMS: SMS AT commands **************** .. contents:: :local: :depth: 2 This page describes SMS-related AT commands. .. note:: |SM|'s SMS implementation is based on the :ref:`lib_sms_readme` library, which uses the following AT commands: ``AT+CMGS``, ``AT+CNMI``, ``AT+CNMA``. These modem AT commands should not be used in conjunction with the ``#XSMS`` command by the host in order to avoid unexpected behavior. The implementation always acknowledges incoming ``+CMT`` and ``+CDS`` notifications with ``AT+CNMA`` command. SMS support #XSMS ================= The ``#XSMS`` command supports functionalities for sending and receiving SMS messages. Set command ----------- The set command allows you to start or stop SMS, as well as send SMS text. Only GSM-7 encoding is supported, 8-bit and UCS2 encodings are not supported. Syntax ~~~~~~ :: AT#XSMS=[,,] * The ```` parameter can accept one of the following values: * ``0`` - Stop SMS. * ``1`` - Start SMS, ready to receive. * ``2`` - Send SMS. * The ```` parameter is a string. It represents the SMS recipient's phone number, including the country code (for example ``+81xxxxxxx``). * The ```` parameter is a string. It is the SMS text to be sent. Unsolicited notification ~~~~~~~~~~~~~~~~~~~~~~~~ This is the notification syntax when an SMS message is received: :: #XSMS: ,, * The ```` parameter is a string. It represents the time when the SMS is received. It has a format of ``YY-MM-DD HH:MM:SS UTC[+|-]HH:MM``. * The ```` parameter is a string. It represents the SMS sender's phone number. * The ```` parameter is a string. It represents the SMS text that has been received. When receiving concatenated SMS messages, there will be only one notification. Example ~~~~~~~ :: at#xsms=1 OK at#xsms=2,"+8190xxxxxxxx","SM test" OK #XSMS: "21-05-24 11:58:22 UTC+09:30","090xxxxxxxx","Tested OK" at#xsms=2,"+8190xxxxxxxx","0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" OK #XSMS: "21-05-24 13:29:47 UTC-09:00","090xxxxxxxx","0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" Read command ------------ The read command is not supported. Test command ------------ The test command tests the existence of the command and provides information about the type of its subparameters. Syntax ~~~~~~ :: AT#XSMS=? Response syntax ~~~~~~~~~~~~~~~ :: #XSMS: ,, Examples ~~~~~~~~ :: at#xsms=? #XSMS: (0,1,2),, OK