-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[components][drivers] fix posix tty, and add more baudrate #8683
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
Conversation
@@ -1095,9 +1102,9 @@ static rt_err_t rt_serial_control(struct rt_device *dev, | |||
} | |||
break; | |||
|
|||
case TCSETAW: |
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.
旧的case需要保留,但可以做个兼容性修正。termio应该是废弃的标准。
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.
termio
是 SVR4 标准的规范,和 POSIX termios
的主要区别是结构体的类型重名了。而我觉得这些不该是 serial 这层处理的。
因为 termios
是 POSIX 针对终端的规范。在 TTY 这一层,类似 termio
这种非 POSIX 标准的兼容性差异都会被处理。所以有了 tty 这个更高层的协议,驱动是不会看到 termio
这个结构体传下来的。
所以对于支持 POSIX 终端的 smart,serial 这边根本不用考虑这个问题。至于没有 TTY 的 RTOS 里面,个人认为没必要做得那么全,反正本来也没有支持全部的控制命令。
请解决冲突文件:
|
@zmshahaha 这个PR导致CI aarch64编译不过 请修复 |
已在pr #8689 解决 |
请拆出来 作为一个独立PR,那个PR推进好像还需要讨论。 |
已拆分到 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
参见https://man7.org/linux/man-pages/man2/ioctl_tty.2.html
当命令cmd为TCGETA等以A结尾,参数应为
struct termio *
,当命令cmd为TCGETS等以S结尾,参数应为struct termios *
此处参数均以
struct termios *
解释,故应变为TCGETS/TCSETS等。部分POSIX函数所设置的波特率不支持,这里添加补充
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up