Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 666313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:48:18+00:00 2026-05-13T23:48:18+00:00

This seems like a simple question, but it is difficult to search for. I

  • 0

This seems like a simple question, but it is difficult to search for. I need to interface with a device over the serial port. In the event my program (or another) does not finish writing a command to the device, how do I ensure the next run of the program can successfully send a command?

Example:

  1. The foo program runs and begins writing “A_VERY_LONG_COMMAND”
  2. The user terminates the program, but the program has only written, “A_VERY”
  3. The user runs the program again, and the command is resent. Except, the device sees “A_VERYA_VERY_LONG_COMMAND,” which isn’t what we want.

Is there any way to make this more deterministic? Serial port programming feels very out-of-control due to issues like this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:48:18+00:00Added an answer on May 13, 2026 at 11:48 pm

    The required method depends on the device.

    • Serial ports have additional control signal lines as well as the serial data line; perhaps one of them will reset the device’s input. I’ve never done serial port programming but I think ioctl() handles this.
    • There may be a single byte which will reset, e.g. some control character.
    • There might be a timing-based signal, e.g. Hayes command set modems use “pause +++ pause”.
    • It might just reset after not receiving a complete command after a fixed time.

    It might be useful to know whether the device was originally intended to support interactive use (serial terminal), control by a program, or both.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like such a simple question, but I'm having such difficulty with it.
this seems like a really simple Question...but behold :) Geek name:string Laser geek_id:integer, power:integer
This seems like a noob question, but the simple answer is eluding me. I
I know this is probably a really simple question but I'm having a brain
I've posted a couple other questions during this process, but I have a better
It seems like the elevation of privileges is a common thing most developers fight
I'm continuing to learn C and would like to adhere to whatever is the
I've been writing tests for a while now and I'm starting to get the
I've used the following in the CSS file of the website. It works on
My MySQL queries are returning arrays with duplicate entries: numbered keys and labeled keys

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.