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.



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

0 – Unsubscribe modem sleep notifications
1 – Subscribe modem sleep notifications
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.
The shortest sleep time indicated to application in ms.
Affects sleep start indications for types 1, 2, 3, 6, and 7.
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 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 is interrupted. Indicated sleep is interrupted.
6 – Sleep is resumed. Indicated sleep has been resumed.
7 – Proprietary PSM.
Sleep time in ms. If the <time> parameter is not present, sleep time is considered infinite. If the <time> parameter is 0, sleep mode is exited. The value might exceed the 32-bit maximum value.
<type> 4 is typically indicated as infinite because the expected sleep time is not known.
<type> 6 is not indicated if less than the <threshold> time is left before wakeup.

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:


The following notification example indicates PSM duration of 320 hours:

%XMODEMSLEEP: 1,1152000000