On 2019-Nov-14, at 10:23 PM, Jim Brain via cctalk wrote:
> If you look at the values received by an 8N1 connection from a sender using
> the different settings, you get:
>
> AT
> at
> At
> aT
> 7E1
> E174
> 41D4
> E1D4
> 4174
> 7O1
> 61F4
> C154
> 6154
> C1F4
> 7M1
> E1F4
> C1D4
> E1D4
> C1F4
> 7S1
> 6174
> 4154
> 6154
> 4174
> 8N1
> 6174
> 4154
> 6154
> 4174
>
> Obviously, still trying to find the magic boolean logic equation to tease out
> the parity, but you could brute force it with these values and only aT would
> cause you issues requiring looking at CR (7E1 would send 8d, while 7S1/8N1
> would send 0d.
(If it is of any consequence at this point)
If those vertical groups of 4 are intended to correspond to the first group of
AT/at/At/aT, then you have the case bit (0x20) inverted, uppercase are bit 0x20
OFF (lower value), lower case are 0x20 ON (higher value).
If it's of any interest, here's some (untested) code, using your finding that
the case must be consistent:
===============================================
/* Return: -1 the two characters are not ASCII A/a and T/t
* -2 the case is not consistent between the two characters
* 0 SPACE parity
* 1 ODD parity
* 2 EVEN parity
* 3 MARK parity
*/
int
AssessATParity( chA, chT )
int chA, chT;
{ int pp;
if( (chA&0x5F)!='A' || (chT&0x5F)!='T' ) // check characters are
A/a and T/t
return( -1 );
if( ((chA^chT)&0x20) != 0 ) // check case is
consistent
return( -2 );
pp = ((chA&0x80)>>6) | ((chT&0x80)>>7); // extract and combine
the two parity bits into two-bit value (0..3)
if( pp==0 || pp==3 ) // check for Space or
Mark parity
return( pp );
return( (chA&0x20) ? pp : (3-pp) ); // Odd or Even parity,
but pp value (1 or 2) must be swapped depending on case
}
====================================================