Recent

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

Alexandr F

  • New Member
  • *
  • Posts: 26
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

  • Hero Member
  • *****
  • Posts: 6647
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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Alexandr F

  • New Member
  • *
  • Posts: 26
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

  • Hero Member
  • *****
  • Posts: 1045
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
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
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.
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Alexandr F

  • New Member
  • *
  • Posts: 26
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.

 

TinyPortal © 2005-2018