[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SerialPort.Open [Polling]?
[Thread Prev] | [Thread Next]
- Subject: Re: SerialPort.Open [Polling]?
- From: Claus Dietrich <claus.dietrich@xxxxxxxxxx>
- Date: Thu, 6 Jun 2024 09:34:37 +0200
- To: Gambas MailingList <user@xxxxxxxxxxxxxxxxxxxxxx>
Am 06.06.24 um 00:19 schrieb Benoît Minisini:
Le 05/06/2024 à 23:47, T Lee Davidson a écrit :I thought Benoît's reply explained it. Does the edit I made to the https://gambaswiki.org/wiki/comp/gb.net/serialport/open page make sense to you? Or, does it need to be reworded for more clarity?It seems ok to me, thanks. -- Benoît Minisini.
Hi Lee and BenoítI can't agree with the current editing and assume that there is still a misunderstanding.
The polling of handshake lines doesn't make any sense to me. These lines have to be handled on the spot and can't be subject to polling cycles. All handshake lines must be treated immediately upon the occurance of an interrupt provided by the UART.
I rather believed, that your first assumption was correct. That means that the presence of received data is indeed checked in a cycle defined by the polling parameter. Since Benoit didn't reply to my question about the detection criteria I am assuming that data are always received byte by byte and put into the buffer.
I also wouldn't say, that "polling is not used when xxxChange events are handled". The use of change events only make sense, if the FlowControl property is set accordingly.
Please apologize that I don't have the competence to fully understand the c-code behind the SerialPort class and I might be entirely wrong, but based on my assumption I would rather have amended the follow to the documentation:
"The optional polling parameter is used to adjust the polling rate for received data in ms. If no parameter is used the default polling rate of 50ms applies. If data are received during the polling cycle they are made available in the Read event handler. Take note that polling is not used when the property Flowcontrol is set to Hardware."
Take this as a counter proposal. Any comment/ correction would be very welcome. We just should try to get it right (also for the Gambas-Buch ;-)).
Regards Claus
Re: SerialPort.Open [Polling]? | BB <adamnt42@xxxxxxxxx> |
Re: SerialPort.Open [Polling]? | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |
SerialPort.Open [Polling]? | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |
Re: SerialPort.Open [Polling]? | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
Re: SerialPort.Open [Polling]? | Claus Dietrich <claus.dietrich@xxxxxxxxxx> |
Re: SerialPort.Open [Polling]? | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |
Re: SerialPort.Open [Polling]? | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |