Hi boys and girls,

I use at-commands through the comport. The problem is if I send "get everything" to the comport the output is about 30 lines of text in under a second. The c# comport listener is only able to capture about 2 of these lines due to the fast output from the comport.

How do I ensure that I get all 30 lines captured by the listener...and slowing the BAUD rate is not going to help me.

Kind Regards
Krefie

Recommended Answers

All 3 Replies

You need to bypass the event listener and construct your own loop code that reads from the port. The problem is that the event you have won't fire fast enough.

Essentially you just need a tight while loop and check for data coming in.

I did think of this, guess I wil have to give it a try.

Was looking for some other solutions aswell...maybe register more than one event listener

Thnx

Unfortunately that wouldn't fix anything.

Is the problem that your buffer is filling up too quickly or that when you get the read there is only 2 lines available and the rest comes after?

If it's the former, you need an external tight loop that also checks whether data is available. For the latter, you can continue to use the event, however, your loop will need to be inside.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.