[Lazarus] Usage of Serial in a testing program?

Sven Barth pascaldragon at googlemail.com
Mon Sep 10 17:09:07 CEST 2018


Bo Berglund via Lazarus <lazarus at lists.lazarus-ide.org> schrieb am Mo., 10.
Sep. 2018, 15:19:

> Concerning the com port name for SerOpen():
>
> { Open the serial device with the given device name, for example:
>     \COM1, \COM2 (strictly, \\.\COM1...) for normal serial ports.
>     ISDN devices, serial port redirectors/virtualisers etc. normally
>     implement names of this form, but refer to your OS documentation.
>   Returns "0" if device could not be found }
> function SerOpen(const DeviceName: String): TSerialHandle;
>
> In the Wiki example they use COMx: where x is a number, but this is
> probably only working for single digit numbers 1..9.
> In any case the naming there is not described in serial.pp
>
> I need to huse a high numbered com port since all I have is USB2Serial
> dongles, which typically get you a port number like 29...
>

Did you test it? Cause the serial unit only passes on the name to the
platform's API. So \COM29 should work for a Com port with number 29.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180910/e537caa9/attachment.html>


More information about the Lazarus mailing list