def add_odd_par(b):
    """
    The chess link protocol is 7-Bit ASCII. This adds an odd-parity-bit to an ASCII char

    :param b: an ASCII character (0..127)
    :returns: a byte (0..255) with odd parity in most significant bit.
    """
    byte = ord(b) & 127
    par = 1
    for _ in range(7):
        bit = byte & 1
        byte = byte >> 1
        par = par ^ bit
    if par == 1:
        byte = ord(b) | 128
    else:
        byte = ord(b) & 127
    return byte