how can i access serial port data in c++ using wxwidgets

↘锁芯ラ 提交于 2019-12-22 09:55:34

问题


i am electronics and communication engineering student. i am working on a project in which a microcontroller send data to serial port of computer (asynchronously). i currently learning wxWidgets for my GUI work.

my question- is it possible to do using wxWidgets to get data and display. is it very difficult to implement this. i search for it but not get direct answer that how to implement this. so suggest me what i need to read for this. and what alternative available to do this. i use windows 7.

i also need to upload this data to web server (it is needed later)


回答1:


wxWidgets, to the best of my knowledge, does not implement serial I/O facilities. There are other libraries available that provide this. One of the best choices is probably boost::asio (see http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/overview/serial_ports.html)




回答2:


wxWidgets is a cross-platform GUI framework.

Reading a serial port is nothing to do with the GUI, and not cross platform.

So wxWidgets has nothing to do with reading serial ports.

You can read/write from/to a serial port using the windows API.

CreateFile opens the port

ReadFile reads data from the port

Difficult? Kinda!




回答3:


I've never used it myself but there is wxCTB.



来源:https://stackoverflow.com/questions/11939513/how-can-i-access-serial-port-data-in-c-using-wxwidgets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!