Modem SLM

The Modem SLM library exposes the AT command interface of the Serial LTE Modem application for external devices over a serial interface. This library is for applications running on external MCU that is built with nRF Connect SDK and is connected to an nRF91 Series SiP through UART.

Overview

The Modem SLM library allows you to perform the following functions:

  • Manage the serial interface so that the application only decides which UART device to use and configures its DTS.

  • Manage the GPIO pins, with support for bidirectional indication and wakeup.

  • Send modem or SLM proprietary AT commands, receive responses and notifications, similar to the AT Host library. Received AT responses or notifications can be parsed by the AT parser library.

  • Send raw data in SLM data mode. Refer to Running in data mode.

  • Monitor AT notifications with registered callbacks, similar to the AT monitor library.

  • Send AT commands via UART or RTT shell, similar to the AT shell library.

Configuration

The library is enabled and configured entirely using the Kconfig system.

Configure the following Kconfig options to enable this library:

Optionally configure the following Kconfig options based on need:

The application must use Zephyr chosen nodes in devicetree to select UART device. Additionally, GPIO can also be selected. For example:

/ {
   chosen {
      ncs,slm-uart = &uart1;
      ncs,slm-gpio = &gpio0;
   };
};

Use one of the following options to select the termination character:

You must configure the same termination character as that configured in SLM on the nRF91 Series SiP. The library sends the termination character automatically after an AT command.

Shell usage

To send AT commands in shell, use the following syntax:

uart:~$ slm AT%XPTW=4,\"0001\"

OK

uart:~$ slm at%ptw?

%XPTW: 4,"0001"
%XPTW: 5,"0011"

OK

SLM accepts AT command characters in upper, lower, or mixed case.

SLM Monitor usage

The SLM Monitor has similar functions to the AT monitor library, except “Direct dispatching”.

SLM_MONITOR(network, "\r\n+CEREG:", cereg_mon);

SLM_MONITOR(download, "\r\n#XDFUGET: 0,", download_mon, MON_PAUSED);

API documentation

Header file: include/modem/modem_slm.h
Source file: lib/modem_slm/modem_slm.c
Source file: lib/modem_slm/modem_slm_monitor.c
Modem SLM library