同时管理两个进程的串口 [英] Manage serial port from two processes simultaneosly

查看:25
本文介绍了同时管理两个进程的串口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下场景:

  • 树莓派通过串口连接到设备
  • 3g Dongle 连接到树莓派(具有拨打/接听电话的能力)
  • 一个进程从串行端口读取数据并将其重定向到服务器(使用 3g)
  • 另一个等待来电的进程,当有人调用该程序时,该程序从串行端口获取数据,并使用 AT 命令(如传真呼叫)通过 3g 加密狗将其重定向.当有人呼叫时,呼叫是使用 AT 命令进行的,呼叫者应该能够与连接到串行端口的最终设备通话".

问题是两个进程使用同一个串口无法共存,当一个进程已经启动时,另一个进程无法从串口读取数据(端口忙).

The problem is that the two processes can not live together since they are using the same serial port, and when one process is already started, the other can not read the data from the serial (port busy).

有没有办法做到这一点?我可以制作一个假"串行端口,或重定向数据的东西吗?

Is there a way to achieve this ? Can i make like a "fake" serial port, or something that redirects the data?

非常感谢

推荐答案

就像所有好的 GSM 东西一样,有一个规范:)

Like all good GSM things there's a specification for that :)

GSM 07.10 是规范,并且有一段时间可以支持您的库.有些是您可以构建到服务器系统中的库,有些是实际的守护进程.

GSM 07.10 is the specification and there are libraries out there for some time that can support you. Some are libraries you can build into your server systems and some are actual daemons.

我敢肯定,快速搜索gsm 多路复用"将帮助您入门.

A quick google for "gsm multiplexing" will get your started that I am sure.

这篇关于同时管理两个进程的串口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆