[squeak-dev] Mark and space parity

Tony Garnock-Jones tonyg at lshift.net
Sat Sep 11 17:44:09 UTC 2010


Hi Bill,

Based on http://www.lothosoft.ch/thomas/libmip/markspaceparity.php, it looks
like you're set if you need 7S1. If you need 8S1, however, the options for
linux are

 - flip between 8N1 and 8E1 depending on the byte to send, or
 - use the undocumented CMSPAR flag.

Given that the SerialPort class in Squeak uses 0, 1, 2 for no, even and odd
parity respectively, and the sqUnixSerial.c driver doesn't support any other
kinds of parity specification (see the table parityTypeDecode), ruling out the
use of CMSPAR, your only option (aside from modifying the SerialPlugin or
writing your own) is to flip between 8N1 and 8E1 for each byte. Unfortunately
it doesn't look like there's a way to get at tcsetattr without also doing an
open, so there goes that idea as well.

In summary: 7S1 ought to be OK (use 8N1 with a cleared 8th bit), but I suspect
that 8S1 is out of reach without changes to the SerialPlugin.

Regards,
  Tony



On 11/09/2010 09:42, Schwab,Wilhelm K wrote:
> I ran across a device (barcode scanner) that uses space parity and dug into vm code to see if it was indeed going to be a problem.  This is not a debate on whether or not the designers of the device could have chosen something else: clearly they should have.  The question is whether our vms should be able to communicate with it, and they should where possible.
> 
> It is not clear whether Linux even supports space parity, though there are hints that recent kernels do so.  Windows certainly does support it.  Have any of you made the required changes and had success with it?  On which operating system(s)?
> 
> Bill
> 
> 
> 



More information about the Squeak-dev mailing list