-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
tools: Add cmux command line tool #14823
base: master
Are you sure you want to change the base?
Conversation
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. While it provides a summary and mentions testing via CI, several crucial pieces of information are missing. Here's a breakdown of what's lacking:
In short, the PR needs to be significantly more detailed to meet the NuttX requirements. It needs to provide a thorough explanation of the changes, their impact, and clear evidence of testing. |
@xiaoxiang781216 I think this application depends on CMUX support in the NuttX kernel, is there a CMUX driver coming to NuttX kernel? |
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.
@xiaoxiang781216 I was thinking this was CMUX support for NuttX, but seems like it has other purpose, probably to run on Linux side. Could you please explain the idea of this tool? Please create a usage() function explain the purpose of this tool.
Yes, it will come in the next patch. |
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.
Please could you add a brief explanation what is cmux and what it is for in the PR description and commit log? Thanks.
Usage: ./nuttx/tools/cmux -d <device> -n <number> -b <baudrate> Please refer to the following link for more information: https://docs.kernel.org/6.1/driver-api/tty/n_gsm.html Signed-off-by: yinshengkai <[email protected]>
4ec7adf
to
96f6097
Compare
already in the code:
|
Update, you can learn the concept and spec from: |
Thank you Xiang! What is the purpose of this external too to NuttX, since NuttX doesn't have CMUX support yet? I think this is the question I and everybody that find this program at nuttx/tools/ will ask. This application is for Linux, not for NuttX, correct? |
@xiaoxiang781216 I think /me and @hartmannathan are asking some question: why to include a program that is supported only for Linux into NuttX? The documentation you provided is for Linux, please consider including a Documentation/ to explain the goal and purpose to have a Linux host CMUX GSM instead of adding CMUX support on NuttX and adding this cmux tool at nuttx-apps |
@xiaoxiang781216 there is an issue already opened asking for CMUX support on NuttX: #7153 |
But in this case the cmux application should be inside nuttx-apps, instead of nuttx/tools/, right? |
Yes, that's why this tool is put into nuttx/tools, not apps/.
Because you need this tool to change host serial port into mux mode.
@Gary-Hobson will provide a NuttX serial driver which implement CMUX protocol.
This tool doesn't need for NuttX since NuttX CMUX driver auto switch to mux mode by config, not through ioctl dynamically.
Yes, after @Gary-Hobson upstream MUX serial driver, #7153 could be closed as complete.
No, NuttX mux driver could work automatically without the setup like Linux, that's why this tool put into nuttx/tools/ not apps/. |
Why? Are you using the modem with SIM? Normally the CMUX will work integrated with PPP and the user should issue a command (or an IOCTL) to setup the CMUX (multiplexed) ports.
Great! Kudos @Gary-Hobson !
Hmm, I think having IOCTL support could be useful in case where we want to enter / leave CMUX during the PPP execution.
Hmm, by automatically you mean statically, right? It should be use some board config to enter in this CMUX mode, correct? |
@xiaoxiang781216 maybe you can include a verbose explanation inside this C file (just before "Included Files") explaining the purpose of this file inside nuttx/tools. This way it could help the absence of proper Documentation/ to this script |
We use cmux for debugging purpose to have the multiple virtual port for nsh/log/gdb at the same time on one physical uart.
in this case, you can bypass cmux tool and do ioctl in your program.
it's hard to handle the enter/leave without the lost data, especially we want syslog can be worked as soon as possible in any environment.
you can config through:
After initialization, you will see all virtual serial ports under /dev/ and use them like the normal uart. Of course, the other side(e.g. Linux) need config by their design as usually. |
The nuttx kernel cmux driver support has been completed, but the internal review has not been completed (need to support sending and receiving data in interrupts). Maybe I can upload the cmux driver in thread mode to the community for review tomorrow (does not support sending and receiving data in interrupts) Currently, it has been verified that it can communicate with the linux kernel, and multiple gsmtty devices can be virtualized in the linux kernel (using cmux tools to configure linux), and the corresponding tty driver will also be generated in the nuttx kernel PPP communication with modem is still to be verified |
@xiaoxiang781216 please include an explanation in the source code or a Documentation/ about this script, to avoid having another script that nobody knows why it is inside nuttx |
Summary
Usage: ./nuttx/tools/cmux -d -n -b
Please refer to the following link for more information:
https://docs.kernel.org/6.1/driver-api/tty/n_gsm.html
Impact
new host tool
Testing
ci