[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SerialPort.Open [Polling]?


On 6/5/24 14:12, Claus Dietrich wrote:
Am 04.06.24 um 12:22 schrieb Benoît Minisini:
Le 04/06/2024 à 03:49, T Lee Davidson a écrit :
https://gambaswiki.org/wiki/comp/gb.net/serialport/open describes the SerialPort.Open method. But, it does not explain what the optional Polling parameter is/does.

Looking at the source code, it appears to be the interval, in milliseconds with a default of 50ms, between polls of the serial port, I assume, to see if there is data available to be read. Is this correct?


According to the source code, polling is only used if you handle one of the 'XXXChange' event. Detecting data availability is always done, and not by polling.

Beware it does not work if you change the event observer of the SerialPort object after having created it.

Regards,

Hi Benoit

Your reply doesn't explain the purpose of the optional polling parameter and since the detection of data is always done, what are the detection-criteria (i.e. byte by byte)?

Best regards

Claus

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?


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: SerialPort.Open [Polling]?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
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>