如何在 Linux 中使用 C 通过串行端口连接发送 .gif 文件

发布于 2024-09-30 03:17:07 字数 142 浏览 1 评论 0原文

我想在 Linux 中使用 C 通过串行端口连接发送 .gif 文件。

另一方面,我知道如何通过连接发送字节并接收它们,但不知道如何使用 .gif 文件执行此操作。

如何通过连接发送每个字节的图像并在另一端重建它?

谢谢。

I would like to send a .gif file over a serial port connection using C in Linux.

I know how to send bytes over the connection and receive them on the other hand, but have no real idea how to do it with a .gif file.

How can I send the image byte per byte over the connection and reconstruct it on the other end?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

赴月观长安 2024-10-07 03:17:07

发送 gif 与发送任何其他字节序列没有什么不同。只要您不使用像某些非二进制连接那样尝试翻译回车符和/或换行符的文件模式,您只需读入文件并发送内容,然后在另一端将它们从连接并将它们写入文件。

Sending a gif is no different than sending any other sequence of bytes. As long as you're not using a file mode that tries to translate carriage returns and/or line feeds like some non-binary connections do, you just read the file in and send the contents, and on the other end read them off the connection and write them to a file.

诠释孤独 2024-10-07 03:17:07

您应该尝试 Zmodem 协议。作为奖励,此站点上有说明和源代码:http://pauillac.inria。 fr/~doligez/zmodem/

You should try the Zmodem protocol. As a bonus, there is a description and source code at this site: http://pauillac.inria.fr/~doligez/zmodem/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文