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 525161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:38:34+00:00 2026-05-13T08:38:34+00:00

I have a program that communicates via serial port to the target. The target

  • 0

I have a program that communicates via serial port to the target. The target is likely a shell or similar program. In case I want to send several commands to the target, how can I know a command is end so that I can send the next command?

I have had some ideas, like catch the shell prompt or let the command output some text before exits. But these will increase the complexity. I’d like to know if there are some other simpler method to achieve it.

  • 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-13T08:38:34+00:00Added an answer on May 13, 2026 at 8:38 am

    It would be impossible to know if a command ended without information going back to the agent issuing the commands with some sort of completion indication. Consider how a *nix terminal works. The *nix terminal was developed exactly for the same kind of situation — issuing remote commands to another PC over some sort of pipe. In that case, how does the user know she can type another command? In the default case, it lets you know its done by giving you a prompt to issue another command. In an edge case it lets you have the process fork from the shell, in which you get an indication that the job has completed.

    It seems the simplest solution is to echo something along the lines of “<< cmd >> complete”.

    Some basic psuedocode

     for (command in commands)
     {
         IssueCommand(command);
         result = "";
         while (result != "complete")
         {
             // read serial port append to result
             result += read(serialPort);
         }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 254k
  • Answers 254k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could create an interface that your library defines to… May 13, 2026 at 10:11 am
  • Editorial Team
    Editorial Team added an answer Use this code: // Get current size of heap in… May 13, 2026 at 10:11 am
  • Editorial Team
    Editorial Team added an answer Create Crystal Reports on the Fly using ASP.NET. I will… May 13, 2026 at 10:11 am

Related Questions

I am working on a Windows utility program which communicates with some custom hardware
I've written a Delphi DLL that communicates with a third party program via COM.
I want to create a very simple HTML/AJAX based GUI for a Python program.
I have a third-party product, a terminal emulator, which provides a DLL that can
I have two separate processes: a C program that outputs comma separated values followed

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.