Skip to content
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

modem: Add SMS messaging support #40393

Open
johnlange2 opened this issue Nov 16, 2021 · 7 comments
Open

modem: Add SMS messaging support #40393

johnlange2 opened this issue Nov 16, 2021 · 7 comments
Assignees
Labels
area: Modem Enhancement Changes/Updates/Additions to existing features

Comments

@johnlange2
Copy link
Collaborator

johnlange2 commented Nov 16, 2021

Many modems support SMS messaging, but there is currently no standard way to use SMS messaging in Zephyr modem drivers.

Proposed solution:
Add a header file (modem_sms.h) with supporting defines and structs
Add two function pointers to struct modem_context for SMS send and receive
Add sms sub-command to modem_shell.c to interactively send and receive SMS messaging
Modem drivers will need to add SMS send and receive functions (this can be added separately)
Support for SMS messaging should be modem-specific with optional implementation

For most modems, only a valid modem context should be needed.
(i.e., no socket must be opened before sending or receiving SMS messages)

In some situations, it may be preferable to send/receive SMS messages using an open socket.
To support this, two ioctl/fcntl commands can be defined in modem_sms.h

@johnlange2 johnlange2 added the Enhancement Changes/Updates/Additions to existing features label Nov 16, 2021
@jukkar
Copy link
Member

jukkar commented Nov 16, 2021

I just wonder if applications could use the BSD socket interface (sendmsg/recvmsg) to send and receive SMS messages. Any opinions about this?

@johnlange2
Copy link
Collaborator Author

Thanks for this suggestion, @jukkar . Using socket functions sendmsg/recvmsg for SMS on an open socket is an interesting idea. There are a couple of considerations though... one is that recvmsg() is not in struct socket_op_vtable. That would be easy to add, but another consideration is that a couple of modem drivers (quectel-bg9x and ublox-sara-r4) use sendmsg for non-SMS purposes, so using it for SMS would likely break them.

@jukkar
Copy link
Member

jukkar commented Dec 7, 2021

Hi @johnlange2, we briefly discussed the SMS recv support API in the todays networking forum. I think we could have is a simple recv API that would allow both polling and blocking API. Just place a timeout option to the API. If the timeout value is K_NO_WAIT, then the recv just checks if there is anything available and returns with proper return code. If the user sets the timeout to K_FOREVER, then the API will wait as long as needed. And if the timeout is some arbitrary value, then the recv will wait that amount.

@johnlange2
Copy link
Collaborator Author

Sounds good, will do. Thanks!

@johnlange2
Copy link
Collaborator Author

I submitted a merge request for this here: #41175

@zephyrbot
Copy link
Collaborator

Hi @bjarki-trackunit,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@johnlange2 you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!

@johnlange2
Copy link
Collaborator Author

This issue is still relevant. My colleague, @jtbaumann, submitted a different PR, #59805, but it has also gotten closed. I believe he intends to either refresh his PR or submit a new one for SMS functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Modem Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

4 participants