-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add runtime chat script support for modem_chat module #62703
Merged
fabiobaltieri
merged 6 commits into
zephyrproject-rtos:main
from
bjarki-andreasen:feature_add_sync_funcs_to_modem_chat
Sep 18, 2023
Merged
Add runtime chat script support for modem_chat module #62703
fabiobaltieri
merged 6 commits into
zephyrproject-rtos:main
from
bjarki-andreasen:feature_add_sync_funcs_to_modem_chat
Sep 18, 2023
Conversation
This file contains 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
bjarki-andreasen
force-pushed
the
feature_add_sync_funcs_to_modem_chat
branch
from
September 15, 2023 12:35
418bc46
to
7f4c703
Compare
This commit adds one new feature, modem_chat_run_script(), which synchronously runs a script. The existing function modem_chat_script_run() is async, and doesn't follow the naming convention created for the other modem modules, specifically, all functions are sync, unless appended with _async. To preserve backwards compatibility, the existing function modem_chat_script_run() will remain until deprecated. It simply calls modem_chat_run_script_async(). Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit adds tests to validate the behavior of the new script run functions. Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
bjarki-andreasen
force-pushed
the
feature_add_sync_funcs_to_modem_chat
branch
from
September 15, 2023 13:53
7f4c703
to
f560bf4
Compare
This commit updates the modem_cellular driver to use the new naming scheme for the modem_chat functions. Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
bjarki-andreasen
force-pushed
the
feature_add_sync_funcs_to_modem_chat
branch
from
September 15, 2023 18:55
16cff87
to
d3b0c5e
Compare
bjarki-andreasen
changed the title
Feature add sync funcs to modem chat
Add runtime chat script support for modem_chat module
Sep 15, 2023
bjarki-andreasen
force-pushed
the
feature_add_sync_funcs_to_modem_chat
branch
2 times, most recently
from
September 16, 2023 08:18
03d18d4
to
30a3a2a
Compare
bjarki-andreasen
requested review from
nashif,
carlescufi,
galak and
MaureenHelm
as code owners
September 16, 2023 08:21
bjarki-andreasen
requested review from
fabiobaltieri,
jukkar and
rerickson1
September 16, 2023 08:21
bjarki-andreasen
force-pushed
the
feature_add_sync_funcs_to_modem_chat
branch
from
September 16, 2023 08:59
30a3a2a
to
a0efd27
Compare
rerickson1
previously approved these changes
Sep 16, 2023
jukkar
reviewed
Sep 17, 2023
This commit optimizes the performance of the script chats by storing the size of requests with the chat script chat, negating the need to use strlen() within the modem_chat module every time a chat script chat request is sent. Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit removes const declarations for members inside structures used for chat scripts to allow for modifying them at runtime. Macros like MODEM_CHAT_SCRIPT_DEFINE() cover the whole struct when declaring them const, ensuring they remain placed in ROM. Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit adds a test to ensure chat scripts can be created and modified at runtime. Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
bjarki-andreasen
force-pushed
the
feature_add_sync_funcs_to_modem_chat
branch
from
September 18, 2023 06:37
a0efd27
to
dbd6ff2
Compare
jukkar
approved these changes
Sep 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rerickson1
approved these changes
Sep 18, 2023
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.
Introduction
This PR makes it possible to construct modem chat scripts and modify them at runtime.
The problem
Some commands require runtime modification, including the response to said commands.
An example is this one for setting the 1PPS configuration of a GNSS modem:
The parameters of the commands will change at runtime, so the chat script
needs to be modifiable at runtime.
The solution
Create a template script in RAM, that is modified before being run by the modem_chat instance.
Additional features
This PR also adds a function to synchronously run a chat script, and updates the naming scheme of the modem_chat module to clearly distinguish between the sync and async variant of the
modem_chat_run_script()
function,modem_chat_run_script_async()
.