Recent

Author Topic: Mac OS serial port access  (Read 1381 times)

Alexandr F

  • New Member
  • *
  • Posts: 25
Mac OS serial port access
« on: February 15, 2019, 05:56:33 pm »
For Windows I use CreateFile, ReadFile, Writefile for serial port communicatrion.

Have Mac os similar function?

I found some examples for Linux (like " fp = open()"), but I can found it in Laxarus for Mac os.

MarkMLl

  • Sr. Member
  • ****
  • Posts: 284
Re: Mac OS serial port access
« Reply #1 on: February 15, 2019, 06:09:07 pm »
FPC has a standard unit called (IIRC) serial.pp which is tested for Linux and Solaris.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

Alexandr F

  • New Member
  • *
  • Posts: 25
Re: Mac OS serial port access
« Reply #2 on: February 15, 2019, 07:35:32 pm »
Mac os version of Lazarus can't found (have not ?) serial unit.

dsiders

  • Full Member
  • ***
  • Posts: 238
Re: Mac OS serial port access
« Reply #3 on: February 15, 2019, 07:51:46 pm »
Mac os version of Lazarus can't found (have not ?) serial unit.

FPC has it for UNIX-like environments... i guess that includes MacOS.

packages/rtl-extra/src/unix/serial.pp
Lazarus 2.0.4 / FPC 3.0.4 / Windows 8.1 64-bit

MarkMLl

  • Sr. Member
  • ****
  • Posts: 284
Re: Mac OS serial port access
« Reply #4 on: February 16, 2019, 06:26:47 pm »
With the important caveat that it's only- as far as I know- been tested in Windows, Linux and Solaris. The thing to watch out for is the precise behaviour of the select() function, see the comments which should be adequately detailed and please make the core developers aware if you can conclusively say that the unit works properly /including/ the various timeouts.
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

Alexandr F

  • New Member
  • *
  • Posts: 25
Re: Mac OS serial port access
« Reply #5 on: February 20, 2019, 02:38:53 pm »
I used BaseUnix unit and FpOpen, FpRead and FpWrite. It working properly for Macintosh.