首页 \ 问答 \ Linux - 与C的多串口通信(Linux - Multiple Serial Port Communication with C)

Linux - 与C的多串口通信(Linux - Multiple Serial Port Communication with C)

我有一个带有多个串口的设备,我用嵌入式linux编程,我想同时和异步地通过这两个端口进行通信。

我知道如何写入一个串口,如:

bytes_sent = write( fd, &(string[i]), 1 );

但这只是一个串口

使用termios结构和c_cflags来区分端口? 正如你所看到的那样有点模糊,我只是潜入水中并且用这种方式弄湿了,任何一般帮助指向我的方向都会有所帮助。


I have a device with multiple serial ports that I am programming with embedded linux and I would like to communicate over these two ports simultaneously and asynchronously.

I know how to write to one serial port such as:

bytes_sent = write( fd, &(string[i]), 1 );

But that's to only one serial port

do I use the termios struct and the c_cflags to differentiate ports? As you can see it's a little vague, I'm just kind of diving in and getting my feet wet with this, any general help to point me vaguely in the right direction will help.


原文:https://stackoverflow.com/questions/16946464
更新时间:2023-11-12 08:11

最满意答案

Stripe提供了Stripe Checkout的“自定义集成” 。 这使您可以从JavaScript启动结账并在结帐时返回令牌。


Stripe offers a "custom integration" of Stripe Checkout. This allows you to launch checkout from javascript and get the token back in checkout.

相关问答

更多
  • 所有静态资源(例如css,js,html文件)都应该位于webapp目录而不是lib目录中。 对于Web应用程序,根目录是webapp 。 所以路径应该从这个目录开始,例如 HTTP://本地主机:7070 /故事板/静态/ JS /角resource.min.js 相应的 web应用/静态/ JS /角resource.min.js All static recources (such as css, js, html files) should be located in webapp director ...
  • 我实际上已经滚过我自己的上传者一次,但只因为我不喜欢任何已经制作的JQuery。 不幸的是,这是专有的,我不能发布在互联网上...但...我可以告诉你如何使用任何来自Angular的任何JQuery插件: 有人可能会说,它容易使用现有的上传器并将其集成到AngularJS中 - 我会说:如果它很容易,那么有人应该已经做到了。 让我们假设我有一个jQuery插件,通过选择一个div并调用pluginUploadCall()在它上面工作... app.directive('myJqueryPluginUploa ...
  • NoClassDefFoundError意味着在编译时找到了类的定义,但在运行时未找到。 最可能的原因是(并且由您显示的日志消息重申)是Stripe类定义在运行时(即在您的设备中)不可用。 但是您没有得到任何编译时错误,因为在您的系统中构建它时该类是可用的。 我检查了Stripe github页面,自述文件信息没有说明生成Stripe.apk(或者需要它)。 你的日食最有可能导致这个问题。 我过去见过这种错误。 切换到Android Studio后,我没有遇到任何这些问题,因为gradle自动获取依赖项并链 ...
  • 你应该看看PouchDB - https://pouchdb.com/ - 你可以使用pouchdb作为http api并从angularJS服务连接到远程couchdb数据库。 如果使用角度1.2到1.5,还有几个pouchdb角度js模块可用。 您可以在此处获取更多信息: https : //pouchdb.com/guides/setup-couchdb.html You should take a look at PouchDB - https://pouchdb.com/ - you can us ...
  • 有什么问题? 它是来自Angular还是Meteor? 不,这是来自@LanderVanBreda,所以我想从“一个很酷的家伙制作你的一天”(我的也是,顺便说一句)。 Meteor在他们的“愿望清单”中有一些角度(和相似)的计划 我真的希望角度+流星真的起飞,但是现在由Lander Van Breda让他们与他的Meteor_angularjs保持最新状态,因为他是唯一维持它的人。 What is the question about? Is it from Angular or Meteor? No, i ...
  • 条纹字段是透明的,以便您可以将背景颜色应用于父元素。 您只需将样式应用于stripe标签。 stripe { display: block; background-color: #fff; border: 1px solid rgba(0,0,0,0.15); border-radius: 0.25rem; padding: 0.5rem 0.375rem; } The Stripe fields are transparent so that you can ap ...
  • 尝试这个 'use strict'; describe('Login User', function () { var app, LoginService; beforeEach(module('app')) ; beforeEach(inject(function(_LoginService_) { LoginService = _LoginService_; })) ; it('Should be logged in', function ( ...
  • Stripe提供了Stripe Checkout的“自定义集成” 。 这使您可以从JavaScript启动结账并在结帐时返回令牌。 Stripe offers a "custom integration" of Stripe Checkout. This allows you to launch checkout from javascript and get the token back in checkout.
  • 要将springSecurityFilterChain添加到您的上下文,您还需要创建一个SpringSecurityInitializer类: public class SpringSecurityInitializer extends AbstractSecurityWebApplicationInitializer { //do nothing } In order to add a springSecurityFilterChain to your context you need to cr ...
  • 我不赞成,但可能你需要在$('#example').DataTable().row.add(["2.0", "Item 2", "Generic Desc", "2", 200]).draw();之后放一个$scope.$apply() $('#example').DataTable().row.add(["2.0", "Item 2", "Generic Desc", "2", 200]).draw(); The solution is in the example below. Basically, I ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。