def set_special_baudrate(port, baudrate):
        import array
        buf = array.array('i', [0] * 32)
        # get serial_struct
        FCNTL.ioctl(port.fd, TERMIOS.TIOCGSERIAL, buf)
        # set custom divisor
        buf[6] = baudrate / buf[7]
        # update flags
        buf[4] &= ~ASYNC_SPD_MASK
        buf[4] |= ASYNC_SPD_CUST
        # set serial_struct
        try:
            res = FCNTL.ioctl(port.fd, TERMIOS.TIOCSSERIAL, buf)
        except IOError:
            raise ValueError('Failed to set custom baud rate: %r' % baudrate)
dataset/ETHPy150Open gepd/Deviot/libs/pyserial/serialposix.py/set_special_baudrate/swapped operands of `/`