Testing ExtendedSerialPort on Linux
Samir Saidani
saidani at info.unicaen.fr
Thu Jun 9 17:13:06 UTC 2005
John M McIntosh <johnmci at smalltalkconsulting.com> writes:
> Only one platform specific primitive or method exists
> serialPortFindNamesPlusKeysstorage which on os-x invokes the
> IOServiceGetMatchingServices() call to get path names to devices
> that support the serial protocols. This primitive call a common
> Linux box could be replaced by smalltalk code to iterate over /dev or
> read some sort of control file etc to figure out the path names to
> the serial devices.
For the moment, for testing, I used a /dev/pts/1 or /dev/tty1
hardcoded.
> self var: #atermios declareC: 'struct termios *atermios'.
> did not turn the atermios into the proper C declare, not sure why.
> However it turn it into a 'char *'
> But if this results in just a compiler warning it still should be ok,
> since the structure is pasted in from the smalltalk side.
agree, but the problem of "char *" ? don't we have to tackle this
problem ? Or is it known to the vm/plugins coders ?
> Lastly the primitive call should return an error code (actually
> errno), what is the value?
> Inserting some printf might tell you if the failure occurs when the
> input data is checked.
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
More information about the Squeak-dev
mailing list
|