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

  • SEARCH
  • Home
  • 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 8719953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:55:12+00:00 2026-06-13T06:55:12+00:00

I have quite a headache about this seemingly easy task: send a break signal

  • 0

I have quite a headache about this seemingly easy task: send a break signal to my device, like the wxTerm (or any similar Terminal application) does.

This signal has to be 125ms long, according to my tests and the devices specification.

It should result in a specific response, but what I get is a longer response than expected, and the transmitted date is false.

e.g.:

what it should respond 08 00 81 00 00 01 07 00

what it does respond 08 01 0A 0C 10 40 40 07 00 7F

What really boggles me is, that after I have used wxTerm to look at my available com-ports (without connecting or sending anything), my code starts to work! I can send then as many breaks as I like, I get my response right from then on. I have to reset my PC in order to try it again.

What the heck is going on here?!

Here is my code for a reset through a break-signal:

 minicom_client(boost::asio::io_service& io_service, unsigned int baud, const string& device)
            : active_(true),
              io_service_(io_service),
              serialPort(io_service, device)
    {
        if (!serialPort.is_open())
        {
                cerr << "Failed to open serial port\n";
                return;
        }           
        boost::asio::serial_port_base::flow_control FLOW( boost::asio::serial_port_base::flow_control::hardware );
        boost::asio::serial_port_base::baud_rate baud_option(baud);
        serialPort.set_option(FLOW);
        serialPort.set_option(baud_option);
        read_start();
        std::cout << SetCommBreak(serialPort.native_handle()) << std::endl;     
        std::cout << GetLastError() << std::endl;
        boost::posix_time::ptime mst1 = boost::posix_time::microsec_clock::local_time();
        boost::this_thread::sleep(boost::posix_time::millisec(125));
        boost::posix_time::ptime mst2 = boost::posix_time::microsec_clock::local_time();    
        std::cout << ClearCommBreak(serialPort.native_handle()) << std::endl;       
        std::cout << GetLastError() << std::endl;           
        boost::posix_time::time_duration msdiff = mst2 - mst1;
        std::cout << msdiff.total_milliseconds() << std::endl;
    }

Edit:

It was only necessary to look at the combo-box selection of com-ports of wxTerm – no active connection was needed to be established in order to make my code work.

I am guessing, that there is some sort of initialisation missing, which is done, when wxTerm is creating the list for the serial-port combo-box.

  • 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-06-13T06:55:13+00:00Added an answer on June 13, 2026 at 6:55 am

    After looking into this more deeply I found out, that I had to setup character_size properly, in order for this to work.

    However I did not really forget this, it was just not necessary until now. When I had my devices already in a post-reset state, they would send their data according to my request – so everything was fine and I only had to specifiy the baud_rate.

    Because no active flow control is an often used default, I thought, here might be some error. However it is really only necessary to setup character_size. Then the break-signal is responded with the expected answer.

    This is the minimal setup:

    minicom_client(boost::asio::io_service& io_service, unsigned int baud, const string& device)
            : active_(true),
              io_service_(io_service),
              serialPort(io_service, device)
    {
        if (!serialPort.is_open())
        {
                cerr << "Failed to open serial port\n";
                return;
        }           
        boost::asio::serial_port_base::character_size CSIZE( 8 );
        boost::asio::serial_port_base::baud_rate baud_option(baud);
        serialPort.set_option( CSIZE );
        serialPort.set_option(baud_option);
        read_start();
        std::cout << SetCommBreak(serialPort.native_handle()) << std::endl;     
        std::cout << GetLastError() << std::endl;
        boost::posix_time::ptime mst1 = boost::posix_time::microsec_clock::local_time();
        boost::this_thread::sleep(boost::posix_time::millisec(125));
        boost::posix_time::ptime mst2 = boost::posix_time::microsec_clock::local_time();    
        std::cout << ClearCommBreak(serialPort.native_handle()) << std::endl;       
        std::cout << GetLastError() << std::endl;           
        boost::posix_time::time_duration msdiff = mst2 - mst1;
        std::cout << msdiff.total_milliseconds() << std::endl;
    }
    

    However, just to be sure, I am setting up all the serial port parameters now.

    The example file found here Boost Asio serial_port – need help with io helped on the way.

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

Sidebar

Related Questions

I have quite a few RewriteRules in my .htaccess that looks like this RewriteRule
This is giving me a headache. I have this link query here that grabs
I have quite a big table (about 4M of entries) for emails that are
i've been on this for days and its givin me quite a headache... I
I thought this was going to be easy, but it's turning into quite a
I have quite a bit of knowledge about SQL queries. I'm trying to make
we have quite a lot of RPG-programs here, and we do a lot of
I have quite a complex piece of code (JQuery and HTML5 Web SQL) that
I have quite a few buttons in my application, they vary in sizes based
I have quite a problem concerning the use of relational database concepts in Delphi

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.