.net - Serial Comms programming structure in c# / net / -


I am an embedded programmer trying to do a little bit coding for a communication app and I started it

I have successfully sent serial data packets, but some types of sending / response protocol are required to avoid overflow over the target system and to ensure that the packet was properly received.

Right now - I have all the communication codes under a button click and it sends a whole lot without any control. What is the best way to setup this code, such as sending some packs - waiting for feedback ... sending more etc ... etc. until all of this is complete, then take with the main program. I have not used threads or callback or will learn this way before in this environment - I just need an indicator in the most Stratford way to do this.

Thanks Rob

.NET uses serialport buffers, work with them learn how to.

The packet is being sent which can be threaded w / o from the sender buffer (far away) small.

Receiving can be done from the event receiving the data, but be careful that it is called from another thread, you can start your own thread and use blocking to read it from there. Are there.

The best way is depending on what your 'packet' and protocol looks like.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -