![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I've noticed that SerialPort.Write() returns when all data has been sent. But is also has a BytesToWrite property, so this wouldn't be logical. So far, I've never seen any value other than 0 for that property. Even with very large blocks, the Write call returns after all chars have been transmitted. And thus, BytesToWrite is always 0. Am I missing something here? |

#3
| |||
| |||
|
|
On Thu, 02 Jul 2009 00:44:46 -0700, Marcel Overweel <moverweel (AT) gonen (DOT) nl wrote: Hi all, I've noticed that SerialPort.Write() returns when all data has been sent. But is also has a BytesToWrite property, so this wouldn't be logical. So far, I've never seen any value other than 0 for that property. Even with very large blocks, the Write call returns after all chars have been transmitted. And thus, BytesToWrite is always 0. Am I missing something here? From my limited experience with the SerialPort class, it seems to me as though the class API is an amalgam of the original unmanaged API and an attempt to provide a more .NET-like way to do things. There are things in the SerialPort class that I can't see myself ever actually using. Probably the biggest category there are these kinds of properties that allow you to inspect the internal state of the SerialPort. To me, knowing that state isn't important, but I suspect that there's code out there that operates at a much less abstract level with certain kinds of hardware that needs to know, thus the existence of features like that in the class. I would say that unless you have code that is specifically timing dependent on the data transmitted through the serial port hardware, you can safely ignore that property. Or, put another way, if that property were important to your code, you'd already know it. ![]() Pete |

#4
| |||
| |||
|
#5
| |||
| |||
|
|
Hi all, I've noticed that SerialPort.Write() returns when all data has been sent. But is also has a BytesToWrite property, so this wouldn't be logical. So far, I've never seen any value other than 0 for that property. Even with very large blocks, the Write call returns after all chars have been transmitted. And thus, BytesToWrite is always 0. Am I missing something here? |
|
regards, Marcel |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |