Testing ExtendedSerialPort on Linux
John M McIntosh
johnmci at smalltalkconsulting.com
Thu Jun 9 18:05:49 UTC 2005
On Jun 9, 2005, at 10:13 AM, Samir Saidani wrote:
>
> Ok done, but it seems that my first guess was wrong, the tcgetattr is
> not involved into the problem...
> This part fails
> if (!((sizeOftermios()) == (interpreterProxy-
> >sizeOfSTArrayFromCPrimitive(atermios)))) {
> interpreterProxy->primitiveFail();
> return null;
> }
>
> and the value of sizeOftermios is 40 whereas the other gives
> 60... what means sizeOfSTArrayFromCPrimitive(atermios) ? Is it maybe
> related to the problem of char* ?
>
> Samir
This means the os-x/FreeBSD/OpenBSD Termios is different size and
structure that your Linux version,
sizeOfSTArrayFromCPrimitive gets the size of the bytearray that is
being passed in. This means the
SerialPortTermios class is not setting the right size of the bytearray.
See the class comments in SerialPortTermios and SerialPortTermiosOSX
class>>stuctureSize
See
SerialPortExtended>defaultExtendedSession
to decide how to instantiate your custom extended session class.
Also see
SerialPortExtendedSessionUnix>>defaultTermiosClass
This is the BSD structure
struct termios {
tcflag_t c_iflag; /* input flags */
tcflag_t c_oflag; /* output flags */
tcflag_t c_cflag; /* control flags */
tcflag_t c_lflag; /* local flags */
cc_t c_cc[NCCS]; /* control chars */
speed_t c_ispeed; /* input speed */
speed_t c_ospeed; /* output speed */
};
see
www.opengroup.org/onlinepubs/ 007908799/xsh/termios.h.html
& of course you need to understand the termios structure your unix
system is using.
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
More information about the Squeak-dev
mailing list
|