Questions tagged [serial-port]
A serial port is a physical interface through which data is transferred (uni- or bidirectionally) one bit at a time. Largely superseded in the consumer market by USB, serial connections are still commonly used in many other specialist applications. Typical applications include scientific/medical instruments, industrial controllers and server diagnostics...
61 questions
5 votes
1 answer
221 views
Memory-optimizing arduino code to be able to print all files from SD card
I started an Arduino project that could execute instructions from an SD card file on the screen. I managed to do it, but another problem appeared: I can't print all the files from the SD card to the ...
3 votes
0 answers
197 views
ASHv2 implementation from scratch - host, transmitter and listener
I am currently implementing the EZSP and the underlying ASHv2 protocols in Rust with the intention to use them on an embedded smart home gateway to control ZigBee devices. In this review I present you ...
1 vote
1 answer
286 views
Serial port class wrapper for serial port object VB.NET
I've been reviewing some code that I maintain recently, and I came across this wrapper object for the serial port class. I'm trying to understand the advantage of this seemingly redundant object: <...
3 votes
0 answers
8k views
What is better - using SerialPort with or without await/async methods?
I'm having an implementation using SerialPort in C# using Visual Studio 2019. I'm using it in a Windows Application, using .NET Framework 4.7.2. When I open and ...
1 vote
1 answer
694 views
Converting decimal to binary in Assembly
The longest example program in my PicoBlaze Simulator in JavaScript is this decimal-to-binary converter: ...
2 votes
1 answer
207 views
Feedback on Traffic Light which revolves around Serial Communication
Assignment description I'd like to receive feedback on an assignment which I'm currently working on. I have to make two traffic lights which allow traffic to run smoothly. I'm using a master Arduino ...
2 votes
0 answers
108 views
Await data coming from an event [closed]
This is a USB related question, but the problem is not USB specific. When reading data from a USB endpoint, there are two patterns I am concerned with. Request/Response like HTTP (done over the Bulk ...
1 vote
1 answer
1k views
Serial port library for unix systems in C using callback model
I wrote a blocking serial port library, Blocking serial port C library, but prefer non-blocking so wrote this library where user can specify callbacks. So it is event driven. The code assumes C99 or ...
2 votes
0 answers
226 views
Blocking serial port C library
I am planning to write a reasonably feature rich serial library but wanted to cut my teeth on something fairly basic. This serial library is fairly simple. It is a thin wrapper on the UNIX open, ...
1 vote
1 answer
181 views
Handling command code and response code in serial port's DataReceived method
I have a function which contains two switches, which check for Command Code and Response Code after that updating UI elements. The code is working fine. How I can reduce or improve those switch cases?...
15 votes
2 answers
7k views
Asynchronous serial port communications class in C++
Please review my serial port class written in C++. It is completely asynchronous, ie event driven. My idea for later is to inherit from this a sync_serial, where timeouts can be specified and it ...
4 votes
3 answers
232 views
Function to check if received message matches any of the expected messages
I have a message coming in and I need to match it against the expected messages. The program will eventually do something as a result of receiving those messages. I am not very experienced at ...
4 votes
2 answers
774 views
ROS node to control Dynamixel servo motors
This code is for a ROS (http://www.ros.org/) node that controls a pair of servo motors (referred to in the code as grippers) that can be controlled individually or together. When they are controlled ...
2 votes
2 answers
3k views
Reading range sensor data from one Serial Port and writing output to another
I'm reading range/distance sensor data from one Serial Port, decoding it and then transmitting it to a secondary device in ASCII format. The sensor uses a 2-byte header with each byte containing the ...
4 votes
1 answer
4k views
A library that reads incoming scale data from USB
I made a simple C# library which detects incoming data from 1 or 2 scales plugged into a computer's usb. My main concerns: I feel like I should potentially be using events/delegates to process the ...