Skip to content

modem: cellular: CELLULAR_EVENT_MODEM_SUSPENDED - #116988

Open
JordanYates wants to merge 3 commits into
zephyrproject-rtos:mainfrom
Embeint:260821_modem_suspend
Open

modem: cellular: CELLULAR_EVENT_MODEM_SUSPENDED#116988
JordanYates wants to merge 3 commits into
zephyrproject-rtos:mainfrom
Embeint:260821_modem_suspend

Conversation

@JordanYates

Copy link
Copy Markdown
Contributor

Add a modem event that is output when the modem transitions back to the idle state. This can be used by higher level application code to monitor unexpected transitions from the modem_cellular state machine.

Handle all events in the sample to demonstrate what can be monitored at the application level.

zafersn
zafersn previously approved these changes Aug 22, 2026
SeppoTakalo
SeppoTakalo previously approved these changes Aug 24, 2026
jukkar
jukkar previously approved these changes Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Zephyr’s cellular driver event API by adding a new event emitted when the modem_cellular state machine transitions into the IDLE state, and updates the cellular modem sample to subscribe to and handle the full set of demonstrated events.

Changes:

  • Adds CELLULAR_EVENT_MODEM_SUSPENDED to the public cellular event mask.
  • Emits the new event from modem_cellular_on_idle_state_enter() in modem_cellular.
  • Updates the samples/net/cellular_modem sample to subscribe once to an “all events” mask and dispatch events via a switch.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
samples/net/cellular_modem/src/main.c Refactors the sample’s callback to handle multiple cellular events and subscribes to a combined event mask.
include/zephyr/drivers/cellular.h Adds the new public event bit for modem IDLE/suspend transitions.
drivers/modem/modem_cellular.c Emits the new event when entering the IDLE state.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread include/zephyr/drivers/cellular.h
Comment thread samples/net/cellular_modem/src/main.c Outdated
Comment thread samples/net/cellular_modem/src/main.c
@JordanYates

Copy link
Copy Markdown
Contributor Author

Added error handling for cellular_set_callback in the sample

zafersn
zafersn previously approved these changes Aug 25, 2026
rerickson1
rerickson1 previously approved these changes Aug 25, 2026
Add a modem event that is output when the modem transitions back to the
idle state. This can be used by higher level application code to monitor
unexpected transitions from the `modem_cellular` state machine.

Signed-off-by: Jordan Yates <jordan@embeint.com>
Always subscribe to modem events in the application, instead of only
when `CONFIG_SAMPLE_CELLULAR_MODEM_AUTO_APN=y`. This will allow
handling additional events with minimal further changes.

Signed-off-by: Jordan Yates <jordan@embeint.com>
Handle all events in the sample to demonstrate what can be monitored
at the application level.

Signed-off-by: Jordan Yates <jordan@embeint.com>
@JordanYates
JordanYates dismissed stale reviews from rerickson1 and zafersn via fa99acd August 25, 2026 23:17
@JordanYates
JordanYates force-pushed the 260821_modem_suspend branch from ddd8970 to fa99acd Compare August 25, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants