wxWidgets与libctb库编写的串口通讯程序

上传者: oyulintianxia | 上传时间: 2019-12-21 20:25:31 | 文件大小: 2.91MB | 文件类型: zip
个人研究成果,wxWidgets的外围通讯库基本一直处于空缺状态,经过几天的研究,将我个人的研究成果上传共享。 本库基于官方于2011年最后一次更新的libctb-0.16版本为基础修改而来,工程使用CodeBlocks创建,相较原版的变更如下。 1.去掉了ctb命名空间,之前用起来感觉有点别扭,所以去掉了,不过为了兼容性考虑,以后可能加回来。 2.IOBase、SerialPort(继承自IOBase)、GPIB(继承自IOBase)三个类修改了构造函数,原来FIFO缓冲的尺寸固定为256,我觉得波特率高时候可能不够用,现在改为通过构造函数传参由用户指定,示例程序中使用4096。 3.修正一个严重的BUG,在SerialPort基类中的OpenDedvice方法中,当串口附加参数为NULL时,类内的附加参数结构体成员将在没有被始化就被使用,进而因参数混乱而导致收发异常,这个BUG目前我已将其修复并进行了测试。 4.对Win32环境下的GetAvailablePorts函数进行重写,现在可以获取串口号超过20的串口(原来的最多到Com20),并且可以得到串口的设备名信息。 5.以上修改只在Windows下测试通过,我手头没有Linux环境,对Linux相关的代码基本是靠着意念盲改,如果您发现了有错误疏漏,欢迎指正,能帮我改改就更好了,比如Linux下如何取得串口设备名我就还没弄明白。 压缩包里有可以编译静态库的工程,以及一个基于wxWidgets3.1的演示工程,就是一个简单的串口收发器,供大家参考。 由于串口功能的实现需要依赖Windows系统API,在Windows下,如果使用Mingw编译,请改你连·请关联静态库libsetupapi.a与libwinmm.a

文件下载

资源详情

[{"title":"( 45 个子文件 2.91MB ) wxWidgets与libctb库编写的串口通讯程序","children":[{"title":"libctb","children":[{"title":"sample","children":[{"title":"res","children":[{"title":"resource.rc <span style='color:#111;'> 55B </span>","children":null,"spread":false}],"spread":true},{"title":"inc","children":[{"title":"CtbSampleMain.h <span style='color:#111;'> 2.71KB </span>","children":null,"spread":false},{"title":"CtbSampleApp.h <span style='color:#111;'> 501B </span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"CtbSampleApp.cpp <span style='color:#111;'> 742B </span>","children":null,"spread":false},{"title":"CtbSampleMain.cpp <span style='color:#111;'> 7.06KB </span>","children":null,"spread":false}],"spread":true},{"title":"build","children":[{"title":"sampleFrame.fbp <span style='color:#111;'> 57.15KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"workspace","children":[{"title":"libctb.workspace.layout <span style='color:#111;'> 265B </span>","children":null,"spread":false},{"title":"libctb.workspace <span style='color:#111;'> 283B </span>","children":null,"spread":false}],"spread":true},{"title":"manual","children":[{"title":"refman.pdf <span style='color:#111;'> 710.86KB </span>","children":null,"spread":false}],"spread":true},{"title":"lib","children":[{"title":"inc","children":[{"title":"ctb","children":[{"title":"getopt.h <span style='color:#111;'> 521B </span>","children":null,"spread":false},{"title":"ctb.h <span style='color:#111;'> 5.61KB </span>","children":null,"spread":false},{"title":"kbhit.h <span style='color:#111;'> 96B </span>","children":null,"spread":false},{"title":"win32","children":[{"title":"getopt.h <span style='color:#111;'> 509B </span>","children":null,"spread":false},{"title":"gpib-32.h <span style='color:#111;'> 18.28KB </span>","children":null,"spread":false},{"title":"timer.h <span style='color:#111;'> 4.07KB </span>","children":null,"spread":false},{"title":"serport.h <span style='color:#111;'> 2.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"serportx.h <span style='color:#111;'> 12.59KB </span>","children":null,"spread":false},{"title":"fifo.h <span style='color:#111;'> 2.64KB </span>","children":null,"spread":false},{"title":"gpib.h <span style='color:#111;'> 11.94KB </span>","children":null,"spread":false},{"title":"iobase.h <span style='color:#111;'> 10.77KB </span>","children":null,"spread":false},{"title":"portscan.h <span style='color:#111;'> 855B </span>","children":null,"spread":false},{"title":"linux","children":[{"title":"timer.h <span style='color:#111;'> 4.07KB </span>","children":null,"spread":false},{"title":"serport.h <span style='color:#111;'> 2.39KB </span>","children":null,"spread":false}],"spread":false},{"title":"timer.h <span style='color:#111;'> 487B </span>","children":null,"spread":false},{"title":"serport.h <span style='color:#111;'> 545B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"src","children":[{"title":"portscan.cpp <span style='color:#111;'> 4.28KB </span>","children":null,"spread":false},{"title":"getopt.cpp <span style='color:#111;'> 455B </span>","children":null,"spread":false},{"title":"win32","children":[{"title":"getopt.cpp <span style='color:#111;'> 1.69KB </span>","children":null,"spread":false},{"title":"timer.cpp <span style='color:#111;'> 2.05KB </span>","children":null,"spread":false},{"title":"serport.cpp <span style='color:#111;'> 13.77KB </span>","children":null,"spread":false}],"spread":true},{"title":"iobase.cpp <span style='color:#111;'> 5.62KB </span>","children":null,"spread":false},{"title":"gpib.cpp <span style='color:#111;'> 10.17KB </span>","children":null,"spread":false},{"title":"serportx.cpp <span style='color:#111;'> 3.06KB </span>","children":null,"spread":false},{"title":"kbhit.cpp <span style='color:#111;'> 570B </span>","children":null,"spread":false},{"title":"linux","children":[{"title":"timer.cpp <span style='color:#111;'> 2.77KB </span>","children":null,"spread":false},{"title":"serport.cpp <span style='color:#111;'> 12.11KB </span>","children":null,"spread":false}],"spread":false},{"title":"fifo.cpp <span style='color:#111;'> 3.18KB </span>","children":null,"spread":false}],"spread":true},{"title":"lib","children":[{"title":"libctbd.a <span style='color:#111;'> 231.19KB </span>","children":null,"spread":false},{"title":"libctb.a <span style='color:#111;'> 46.31KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"projects","children":[{"title":"codeblosks","children":[{"title":"libctb.cbp <span style='color:#111;'> 2.42KB </span>","children":null,"spread":false},{"title":"LibCtbSample.cbp <span style='color:#111;'> 3.17KB </span>","children":null,"spread":false},{"title":"LibCtbSample.depend <span style='color:#111;'> 64.75KB </span>","children":null,"spread":false},{"title":"libctb.layout <span style='color:#111;'> 178B </span>","children":null,"spread":false},{"title":"LibCtbSample.layout <span style='color:#111;'> 595B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"build","children":[{"title":"bin","children":[{"title":"Release","children":[{"title":"CtbSample.exe <span style='color:#111;'> 6.69MB </span>","children":null,"spread":false}],"spread":true},{"title":"Debug","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • wxp618 :
    很不错的东西,有一定难度,主要还是没资料
    2020-11-11
  • wxp618 :
    很不错的东西,有一定难度,主要还是没资料
    2020-11-11
  • qq_26868981 :
    下载完了也不会用
    2020-08-13
  • qq_26868981 :
    下载完了也不会用
    2020-08-13
  • caocao1980 :
    门外汉,还不知道如何入门,下载的源码能在windows下运行。
    2019-02-18
  • CaoCao1980 :
    门外汉,还不知道如何入门,下载的源码能在windows下运行。
    2019-02-18
  • throg :
    楼主这个资源不错,我下载了,软件测试了。在Windows下,如果使用Mingw编译,请改你连·请关联静态库libsetupapi.a与libwinmm.a,这个我不会弄啊,不知道可不可以改到支持961
    2017-10-20
  • throg :
    楼主这个资源不错,我下载了,软件测试了。在Windows下,如果使用Mingw编译,请改你连·请关联静态库libsetupapi.a与libwinmm.a,这个我不会弄啊,不知道可不可以改到支持961
    2017-10-20

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明