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

ppp_recv_entry中的PPP_STATE_PREPARE下,丢掉脏数据的处理不合理 #26

Open
denghengli opened this issue Jul 24, 2021 · 1 comment

Comments

@denghengli
Copy link

    if (device->state == PPP_STATE_PREPARE)
    {
            ......
            /* throw away the dirty data in the uart buffer */
            rt_device_read(device->uart, 0, buffer, PPP_RECV_READ_MAX);
            .....
    }

在ppp_recv_entry中,模块拨号成功后,加了清理脏数据处理。如果真有脏的数据,这样最多也只能清理掉PPP_RECV_READ_MAX(32字节)长度的数据吧,如果RT_SERIAL_RB_BUFSZ比PPP_RECV_READ_MAX大,是清理不干净的

@denghengli denghengli changed the title PPP_STATE_PREPARE中,丢掉脏数据不合理 PPP_STATE_PREPARE中,丢掉脏数据的处理不合理 Jul 24, 2021
@denghengli denghengli changed the title PPP_STATE_PREPARE中,丢掉脏数据的处理不合理 ppp_recv_entry中的PPP_STATE_PREPARE下,丢掉脏数据的处理不合理 Jul 24, 2021
@xiangxistu
Copy link
Collaborator

确实是有这个可能性的,一般来说,AT 命令开启 PPP 拨号后,一旦模块回复了 connent ,后续的数据就为 PPP 格式的数据。

不过在 master 版本,已经删掉了这个逻辑;在具体的使用中发现,ppp 的帧结构有压缩的情况;而且 lwip 内部也有对 ppp 完整性的判断,所以在 1.0.0 后就删除了这个逻辑。直接把数据交到 lwip 的 ppp 中去匹配了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants