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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:35:01+00:00 2026-05-15T17:35:01+00:00

enter code here I’m reading a stream from a device in Linux which contains

  • 0

enter code hereI’m reading a stream from a device in Linux which contains hexidecimal letters and is delimited by “^M”. Whenever the device is ready for more information it sends the character “>”. The stream looks like this:

^M^M01 02 F3^M00 01 F3 3E^M>"

I need to detect the char > and perform an action on that char. Is there a way I can delimit on “>” and have that character read?

Basically it currently looks like this

 01 02 F3
00 01 F3 3E

I need > to trigger a separate action.
It does not trigger the read buffer if just a single char is in there for some reason. I’m delmiting on ^M. I need > to do something else.

  • 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-15T17:35:01+00:00Added an answer on May 15, 2026 at 5:35 pm

    It’s quite possible to do this. I recently wrote a project which read input from multiple mice using a very similar interface. The binary data from the mice came in via file I/O.

    I think buffered I/O is inappropriate here. Buffered I/O will try to fill a buffer for you, for performance reasons. But it seems that your app will be spending most of its time waiting for new characters. If you’re not reading in bulk, then raw byte reads InputStream will do the trick: They will return immediately after the requested/expected number of bytes (1 in your case) have been received. In your case, after reading the > character, you’d issue another single-byte read for the following char.

    You’ll need to figure out what to do with intervening characters. Once you’ve processed your > and the following char, what do you want to do with any following characters that are not >?

    What I did in my app was to directly read single bytes from an InputStream. This would block, so it had to be done in a separate Thread that spent most of its time waiting. When the first character came in, I knew to read a handful more (just like you will), which I could then process. I had some kind of queue set up for passing this information to the rest of my app – you’ll have to work out some kind of synchronization for your inter-thread communication.

    EDIT: Multiple small edits to clarify points. Sorry if this ends up confusing.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Call the Focus method on the Form, i.e. this.Focus() May 16, 2026 at 6:45 pm
  • Editorial Team
    Editorial Team added an answer It is an implementation detail that is not known (or… May 16, 2026 at 6:45 pm
  • Editorial Team
    Editorial Team added an answer Pull can't pull a range of revisions because every mercurial… May 16, 2026 at 6:45 pm

Trending Tags

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

Top Members

Related Questions

enter code here I have a table on SQL server 2005 with bigint primary
enter code here Hi All, I have a simple windows service application that connects
enter code here hi. i am trying to implment custom paging in datalist control
I have one html structure: enter code here <ul> <li><span>aaa</span> <div> <ul> <li><span>bbb</span> </li>
I'm trying to remove annota enter code here tion some a MKMapView but am
I am porting some code from linux to windows and am coming up with
Here's the code : cout << Please enter the file path: ; string sPath;
here is post my code:this is no the entire code but enough to explain
I am updating some list items through code. Here is an example of what
I have a 2 files here. One is my main form, and the other

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.