serial-port

Worker threads with shared resources in Qt application

╄→尐↘猪︶ㄣ 提交于 2019-12-13 00:24:00
问题 I am working on a Qt application which involves serial communication with one or multiple devices. There are different procedures that can be executed simulteanously and each procedure may send one or unknown number of commands to a device and may receive data in response. To make it more clear, here is a graphical illustration of the scenario: Clicking on a button triggers the execution of the corresponding procedure. So two or more different procedures may be running at the same time when

Keep Chrome Packaged App running in background?

青春壹個敷衍的年華 提交于 2019-12-12 22:12:30
问题 I'm trying to build a Chrome app and/or extension to communicate with a serial device (using https://developer.chrome.com/apps/serial), to use for showing data from the device on a webpage. I've created an app that can read messages from my device but I now need to get those messages to my webpage. My plan was to create an extension that communicates with my app and then updates my webpage. My extension sends messages to the app using "chrome.runtime.sendMessage" and my app then responds with

Send the string to its hex equivalent

一曲冷凌霜 提交于 2019-12-12 20:43:27
问题 I would like to send hex commands to my device because it can only understand hex . Because of that I manage to create a function that can validate if the users input which is a string has a valid corresponding hex . The question is here. So, by validating if the users input has a corresponding hex equivalent I am confident that what my system sends will be read by my device. By searching I realized that it needs to be converted to bytes, it states Use the ASCIIEncoding class to convtert

Baud rate limits in software and serial communication with an external device

☆樱花仙子☆ 提交于 2019-12-12 16:42:58
问题 I am using a USB port port operating as a virtual COM port to achieve serial communication with an external device using MATLAB or Visual Basic 6. I am facing baud rate limitations depending on the software I use to communicate with the device. MATLAB (2018a) has no problems because it can set high baud rates. Visual Basic 6 on the other hand faces limitations on the baud rates that can be set in the software. In terms of solutions, I have looked into this to set a higher baud rate in Visual

Java SerialPort communication, wrong input bytes on receiver

自闭症网瘾萝莉.ら 提交于 2019-12-12 15:12:35
问题 When I`m sending bytes to receiver (using java), some of received byte values chaotically changing to 0x3F. (0x0 all the time changing to 0x3F) java src: serialPort = new SerialPort(portName); serialPort.openPort(); serialPort.setParams( SerialPort.BAUDRATE_9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.writeBytes(new byte[]{0,3,(byte)240,1,(byte)242}); When I`m using arduino for data trasmission, everything works fine. Arduino src: byte b[5]={0,3,240

Linux command to send binary file to serial port with HW flow control?

独自空忆成欢 提交于 2019-12-12 14:43:16
问题 I need to send binary file to rs232 device (printer) which not always can accept data and so it has BUSY output signal, which i connect to CTS pin. I try to use it with minicom , and hardware flow control works just fine. But i can't send raw file using minicom, it works wrong ant i think minicom not loves zeroes in file. At other hand, i try to use cat file > /dev/ttyS5 , along with stty -F /dev/ttyS5 clocal or stty -F /dev/ttyS5 crtscts . None of this work: HW control not work at all, data

Double way Serial communication between Arduino and Qt 5.7

隐身守侯 提交于 2019-12-12 14:15:48
问题 I am trying to transfer data from Arduino to a C++ Qt5.7 and from a Arduino to a C++ Qt5.7 (MinGW) program. I am able to transfer the data FROM QT TO ARDUINO without any problems. The Arduino blinks perfectly. On the other hand, the data transfered FROM THE ARDUINO TO QT isnt always the expected (sends "LED ON" when it should be "LED OFF") and sometimes it doesnt communicate at all! QT code: #include <QCoreApplication> #include <QDebug> #include <QSerialPort> #include <QSerialPortInfo>

Invalid handle error when connecting to COM port higher than 10 on Windows 7

左心房为你撑大大i 提交于 2019-12-12 13:10:57
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . I have developed a simple serial port application that works fine with COM ports lower than 10 (COM9, COM8, ... COM1). But when my device is attached on a port higher than 10, such as COM11, it doesn't connect and I get an INVALID_HANDLE. My code is: comport = CreateFileA(comPortName.toAscii(), GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,

Using DMA to access High Speed Serial Port

 ̄綄美尐妖づ 提交于 2019-12-12 12:23:15
问题 I use serialport component in c# and it works well! But the question is how can it be faster to handle high speed (e.g. 2 Mbps) data transfers. As I have researched about this, I have found that memory can be accessed directly (using DMA like this link ). Can anybody tell me how can I define and use it in my application? 回答1: No, the [c#] tag puts this a million miles out of reach. The code snippet on that web page is not real, it is just a "pattern". It does things you cannot do in C#, like

UART initialisation: Prevent UART to pull RTS high

你说的曾经没有我的故事 提交于 2019-12-12 12:07:09
问题 I'm writing a RS485 driver for an ARM AT91SAM9260 board on Linux. When I initialise the UART, the RTS signal line gets high (1). I guess this would and should be the standard behaviour in RS232 operation mode. In RS485 mode however this is not wanted. I'm using the standard functions provided by the arm-arch section to initialise the UART. Therefore the significant steps are: at91_register_uart(AT91SAM9260_ID_US2, 3, ATMEL_UART_CTS | ATMEL_UART_RTS); //consisting of: // >> configure/mux the