On Wed, May 14, 2014 at 10:15 AM, Goubier Thierry <thierry.goubier@cea.fr> wrote:
Hi all,

has anybody success using serial ports with Pharo on Mac or Linux? We're having reports of lack of success, including lack of success in recompiling a Pharo VM with a correct serial port access (a few months ago), where the same approach was sucessfull with a squeak VM.

I see that the current out of the box build gives:

buildUnix32
CogNativeBoostPlugin setTargetPlatform: #Linux32PlatformId.
PharoUnixConfig new
"generateForDebug;"
addExternalPlugins: #( FT2Plugin SqueakSSLPlugin );
addInternalPlugins: #( UnixOSProcessPlugin ��);
addThirdpartyLibraries: #(��
'libssh2'��
'libgit2' );
generateSources;��
generate.

So, there is no SerialPlugin in there for sure.

platforms/unix/plugins/SerialPlugin has the unix specific code with the primitives implementation.

It looks like the code uses those to access the serial ports.

#ifdef BUILD_FOR_OSX
static const char *serialPortBaseNameDefault = "/dev/ttys%d";
#else
static const char *serialPortBaseNameDefault = "/dev/ttyS%d";
#endif

and the SerialPlugin code inside the image looks okay.

Changing the buildUnix32 into:

buildUnix32
CogNativeBoostPlugin setTargetPlatform: #Linux32PlatformId.
PharoUnixConfig new
"generateForDebug;"
addExternalPlugins: #( FT2Plugin SqueakSSLPlugin );
addInternalPlugins: #( UnixOSProcessPlugin SerialPlugin );
addThirdpartyLibraries: #(��
'libssh2'��
'libgit2' );
generateSources;��
generate.

generates all without an issue.

Now, I am going to compile this on CentOS and get back to you.

Phil


��


Thierry
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Syst��mes Temps R��el Embarqu��s
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95