Set command

The set command subscribes and unsubscribes all types of modem sleep notifications. The notification returns the type of sleep. The application can use the warning time to trigger an action before modem wakeup. The <threshold> parameter is used to indicate the length of the sleep periods the application is interested in.

Syntax:

%XMODEMSLEEP=<n>[,<warning_time>,<threshold>]

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

<n>
0 – Unsubscribe modem sleep notifications
1 – Subscribe modem sleep notifications
<warning_time>
Advance warning time in ms. A notification is sent as a prewarning of modem wakeup.
Range 500–3600000 ms.
Value 0 can be used if advance warning is not needed.
The <warning_time> parameter is required when <n> is 1.
<threshold>
The shortest sleep time indicated to application in ms.
Range 10240–3456000000 ms.
The <threshold> parameter is required when <n> is 1.

Notification syntax:

%XMODEMSLEEP: <type>[,<time>]

The notification parameters and their defined values are the following:

<type>
Type of modem sleep
1 – Power Saving Mode (PSM). Modem is in power saving mode.
2 – RF inactivity. Modem sleeps due to RF inactivity, including Extended Discontinuous Reception (eDRX).
3 – Limited service. Modem sleeps due to being out of coverage.
4 – Flight mode. Modem has been set to flight mode.
5 – Sleep interrupted. Indicated sleep is interrupted.
6 – Sleep resumed. Indicated sleep has been resumed.
<time>
Sleep time in ms. If the <time> parameter is not present, sleep time is considered infinite. The value might exceed the 32-bit maximum value.

The following command example subscribes modem sleep notifications. The shortest indicated sleep time is 60 seconds, and a notification is sent 1 second before the end of sleep:

AT%XMODEMSLEEP=1,1000,60000

The following notification example indicates PSM duration of 320 hours:

%XMODEMSLEEP: 1,1152000000