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

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

问题描述

我有以下情况:

  • Rasperry pi通过串行端口连接到设备
  • 与树莓相连的3g加密狗(具有拨打/接听电话的能力)
  • 一个进程从串行端口读取数据并将其重定向到服务器(使用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.

我敢肯定,一个快速的Google进行"gsm复用"将使您起步.

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

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

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