Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: XE7 MAC access serial port



Permlink Replies: 8 - Last Post: Nov 20, 2014 1:36 PM Last Post By: Fergus Dixon
Fergus Dixon

Posts: 16
Registered: 5/10/07
XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 18, 2014 9:07 PM
Hi , I have a Windows program which access serial ports. I would like to transfer it to Firemonkey and access a serial port on a MAC

Apple have this webpage, but the open function called below causes errors and I am not sure how to include header files such as <fcntl.h>
fileDescriptor = open(bsdPath, O_RDWR | O_NOCTTY | O_NONBLOCK);

https://developer.apple.com/library/mac/samplecode/SerialPortSample/Listings/SerialPortSample_SerialPortSample_c.html#//apple_ref/doc/uid/DTS10000454-SerialPortSample_SerialPortSample_c-DontLinkElementID_4

I have downloaded synapse and synaser and it works great for windows but not for mac. Any help would be much appreciated. Thanks
Eli M

Posts: 1,346
Registered: 11/9/13
Re: XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 18, 2014 9:50 PM   in response to: Fergus Dixon in response to: Fergus Dixon
Brian Hamilton ...

Posts: 556
Registered: 10/14/04
Re: XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 19, 2014 2:38 PM   in response to: Eli M in response to: Eli M

this works :)
Fergus Dixon

Posts: 16
Registered: 5/10/07
Re: XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 20, 2014 1:35 PM   in response to: Eli M in response to: Eli M

Hi Eli, OK I am convinced - especially as the source code is supplied so this sounds like a good deal.. I have just transferred the $60. Thanks
Grant Beattie

Posts: 77
Registered: 11/29/01
Re: XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 19, 2014 12:24 PM   in response to: Fergus Dixon in response to: Fergus Dixon
Fergus Dixon

Posts: 16
Registered: 5/10/07
Re: XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 19, 2014 11:34 PM   in response to: Fergus Dixon in response to: Fergus Dixon
Fergus Dixon wrote:
Hi , I have a Windows program which access serial ports. I would like to transfer it to Firemonkey and access a serial port on a MAC

Apple have this webpage, but the open function called below causes errors and I am not sure how to include header files such as <fcntl.h>
fileDescriptor = open(bsdPath, O_RDWR | O_NOCTTY | O_NONBLOCK);

https://developer.apple.com/library/mac/samplecode/SerialPortSample/Listings/SerialPortSample_SerialPortSample_c.html#//apple_ref/doc/uid/DTS10000454-SerialPortSample_SerialPortSample_c-DontLinkElementID_4

I have downloaded synapse and synaser and it works great for windows but not for mac. Any help would be much appreciated. Thanks

Thanks for the replies. Winsoft may be good but I am not paying $60 or $180 for something which should be free and which I cannot try first. A bit like charging someone $60 to drive out of the garage.

I looked at the hardware access page, But I am more looking for the code to drive the serial port. I can use CoolTerm to access serial ports and this is a great serial terminal emulator but we need to have our own program.
Grant Beattie

Posts: 77
Registered: 11/29/01
Re: XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 20, 2014 6:24 AM   in response to: Fergus Dixon in response to: Fergus Dixon
I'm guessing if you can get the (symbolic?) name you can use good old file i/o. There's unix in there so I'd be surprised if that didn't work.
Eli M

Posts: 1,346
Registered: 11/9/13
Re: XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 20, 2014 7:27 AM   in response to: Fergus Dixon in response to: Fergus Dixon
You have to translate the header files (*.h) to Object Pascal to use them. For me $60 vs. translating headers? $60 wins.

http://blog.andrewmadsen.com/post/26512371699/orsserialport-a-new-objective-c-serial-port-library
http://www.harmless.de/cocoa-code.php#serialport

You can also talk to the serial port on the command line:

{$IFDEF POSIX}
  _system(PAnsiChar('/Users/drummerboyx/Library/Scripts/arduino-serial -b 9600 -p /dev/tty.usbserial-A800ev0Z -s 1'));
{$ENDIF POSIX}


To pipe the command line into Delphi you can do:
http://codeverge.com/embarcadero.delphi.firemonkey/how-can-i-output-terminal-to-st/1043733
Fergus Dixon

Posts: 16
Registered: 5/10/07
Re: XE7 MAC access serial port
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 20, 2014 1:36 PM   in response to: Eli M in response to: Eli M
OK, sounds good. Transfer has just been completed. Thanks
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02