non-tragic serial port or uart in swift?

I have previously written Swift code for UART or serial port that had to bridge to C. Is there a way now to do two-way legacy UART or serial port communication in Swift without resorting to tragedy? I'm debugging a piece of hardware it only communicates over UART or serial port. I only need it to run on my machine I'm not trying to distribute the app, it isn't a question of permission or authority.

Answered by CodeWarrior in 222594022

Bug report 31557098

It was back in 2014 I was required to bridge to C to write a wrapper for UART / Serial Port access. In 3 years has Apple implemented a UART / SerialPort API yet that is native to Swift? UART / SerialPort is fundamental to the hardware developer experience. The maker movement is exploding. The code required to access UART / SerialPort on macOS looks and feels ill-formed, and beyond my intelligence to understand why an API native to Swift does not yet exist. It is a let-down to your typical preteen developer who is first getting into hardware development to have to go to a Microsoft platform (Windows) to write simple UART / SerialPort code (in this case C# using .NET). The 0.01% of people in the tech industry that control 99.9% of it, senior hardware and software developers, also video production studios, and anyone who needs a compute cluster, are underserved by Apple. I am disgruntled here with my $11k Mac Pro paperweight not being able to do something as simple as connecting to a UART / Serial Port programmatically using native Swift. Searching developer.apple.com for examples of UART / Serial Port access I get zero relevant hits. I'll open a bug I guess.

Accepted Answer

Bug report 31557098

Is there any UART method of SWIFT that can be called now?

non-tragic serial port or uart in swift?
 
 
Q