Add Cellular_Ping function and enhance AT read logging#5
Merged
Conversation
Adds Cellular_Ping() to cellular_api.h — synchronous ping returning the raw modem result code from AT+QPING (0 = success, 565 = routing failure, 569 = timeout, -1 = URC not received). Uses the same queue/URC pattern as Cellular_GetHostByName. Improves _Cellular_ReadLine debug logging to show actual data content (up to 50 bytes) rather than a pointer address, making AT traces readable in serial logs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new public API declaration for modem ICMP pinging and updates packet I/O debug logging to print readable AT RX content (capped to 50 bytes) instead of a pointer value.
Changes:
- Add
Cellular_Ping()prototype and Doxygen documentation to the public API header. - Update
_Cellular_ReadLinedebug logging to print received content (first 50 bytes) rather than the buffer address.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| source/include/cellular_api.h | Declares the new Cellular_Ping() API and documents expected return semantics. |
| source/cellular_pktio.c | Improves AT read debug logging by printing buffer content up to a fixed limit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The AT read debug logging changes in fe81a99 were inadvertently included and are not part of the Cellular_Ping work. Restoring the original LogDebug call so this PR only adds the new API declaration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
robweiss
added a commit
that referenced
this pull request
May 1, 2026
* feat: Add Cellular_Ping and improve AT read logging Adds Cellular_Ping() to cellular_api.h — synchronous ping returning the raw modem result code from AT+QPING (0 = success, 565 = routing failure, 569 = timeout, -1 = URC not received). Uses the same queue/URC pattern as Cellular_GetHostByName. Improves _Cellular_ReadLine debug logging to show actual data content (up to 50 bytes) rather than a pointer address, making AT traces readable in serial logs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * revert: drop unintended cellular_pktio.c logging changes The AT read debug logging changes in fe81a99 were inadvertently included and are not part of the Cellular_Ping work. Restoring the original LogDebug call so this PR only adds the new API declaration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Cellular_Ping() to cellular_api.h — synchronous ping returning the raw modem result code from AT+QPING (0 = success, 565 = routing failure, 569 = timeout, -1 = URC not received). Uses the same queue/URC pattern as Cellular_GetHostByName.
Improves _Cellular_ReadLine debug logging to show actual data content (up to 50 bytes) rather than a pointer address, making AT traces readable in serial logs.
This pull request introduces a new API for sending ICMP pings from the modem and improves debug logging in the AT command read function. The most important changes are grouped by theme below.
New Feature: ICMP Ping API
Cellular_Pingtocellular_api.h, which allows sending a single ICMP ping using the modem and returns the raw modem result code. This function provides details on parameters and return values in its documentation.Logging Improvements
_Cellular_ReadLineincellular_pktio.cto avoid printing excessively large data buffers. Now, if more than 50 bytes are read, only the first 50 bytes are logged, improving log readability and safety.Description
Test Steps
Checklist:
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.