def __init__(self, channel, can_filters=None, **kwargs):
        """
        :param int channel:
            The Channel id to create this bus with.

        :param list can_filters:
            See :meth:`can.BusABC.set_filters`.

        Backend Configuration

        :param int bitrate:
            Channel bitrate in bit/s.
            Default is 500000.

        :param int device_number:
            The device number of the USB-CAN.
            Valid values: 0 through 254. Special value 255 is reserved to detect the first connected device (should only
            be used, in case only one module is connected to the computer).
            Default is 255.

        :param can.bus.BusState state:
            BusState of the channel.
            Default is ACTIVE.

        :param bool receive_own_messages:
            If messages transmitted should also be received back.
            Default is False.

        :param int rx_buffer_entries:
            The maximum number of entries in the receive buffer.
            Default is 4096.

        :param int tx_buffer_entries:
            The maximum number of entries in the transmit buffer.
            Default is 4096.

        :raises ValueError:
            If invalid input parameter were passed.

        :raises can.CanError:
            If hardware or CAN interface initialization failed.
        """
        try:
            self._ucan = Ucan()
        except Exception:
            raise ImportError("The SYSTEC ucan library has not been initialized.")

        self.channel = int(channel)
        device_number = int(kwargs.get('device_number', ANY_MODULE))

        # configuration options
        bitrate = kwargs.get('bitrate', 500000)
        if bitrate not in self.BITRATES:
            raise ValueError("Invalid bitrate {}".format(bitrate))

        state = kwargs.get('state', BusState.ACTIVE)
        if state is BusState.ACTIVE or state is BusState.PASSIVE:
            self._state = state
        else:
            raise ValueError("BusState must be Active or Passive")

        # get parameters
        self._params = {
            "mode": Mode.MODE_NORMAL |
                    (Mode.MODE_TX_ECHO if kwargs.get('receive_own_messages') else 0) |
                    (Mode.MODE_LISTEN_ONLY if state is BusState.PASSIVE else 0),
            "BTR": self.BITRATES[bitrate]
        }
        # get extra parameters
        if kwargs.get("rx_buffer_entries"):
            self._params["rx_buffer_entries"] = int(kwargs.get("rx_buffer_entries"))
        if kwargs.get("tx_buffer_entries"):
            self._params["tx_buffer_entries"] = int(kwargs.get("tx_buffer_entries"))

        self._ucan.init_hardware(device_number=device_number)
        self._ucan.init_can(self.channel, **self._params)
        hw_info_ex, _, _ = self._ucan.get_hardware_info()
        self.channel_info = '%s, S/N %s, CH %s, BTR %s' % (
            self._ucan.get_product_code_message(hw_info_ex.product_code),
            hw_info_ex.serial,
            self.channel,
            self._ucan.get_baudrate_message(self.BITRATES[bitrate])
        )
        super(UcanBus, self).__init__(channel=channel, can_filters=can_filters, **kwargs)
def __init__ ( self , channel , can_filters = None , ** kwargs ) : try : self . _ucan = Ucan ( ) except Exception : raise ImportError ( "The SYSTEC ucan library has not been initialized." ) self . channel = int ( channel ) device_number = int ( kwargs . get ( 'device_number' , ANY_MODULE ) ) bitrate = kwargs . get ( 'bitrate' , 500000 ) if bitrate not in self . BITRATES : raise ValueError ( "Invalid bitrate {}" . format ( bitrate ) ) state = kwargs . get ( 'state' , BusState . ACTIVE ) if state is BusState . ACTIVE or state is BusState . PASSIVE : self . _state = state else : raise ValueError ( "BusState must be Active or Passive" ) self . _params = { "mode" : Mode . MODE_NORMAL | ( Mode . MODE_TX_ECHO if kwargs . get ( 'receive_own_messages' ) else 0 ) | ( Mode . MODE_LISTEN_ONLY if state is BusState . PASSIVE else 0 ) , "BTR" : self . BITRATES [ bitrate ] } if kwargs . get ( "rx_buffer_entries" ) : self . _params [ "rx_buffer_entries" ] = int ( kwargs . get ( "rx_buffer_entries" ) ) if kwargs . get ( "tx_buffer_entries" ) : self . _params [ "tx_buffer_entries" ] = int ( kwargs . get ( "tx_buffer_entries" ) ) self . _ucan . init_hardware ( device_number = device_number ) self . _ucan . init_can ( self . channel , ** self . _params ) hw_info_ex , _ , _ = self . _ucan . get_hardware_info ( ) self . channel_info = '%s, S/N %s, CH %s, BTR %s' % ( self . _ucan . get_product_code_message ( hw_info_ex . product_code ) , hw_info_ex . serial , self . channel , self . _ucan . get_baudrate_message ( self . BITRATES [ bitrate ] ) ) super ( UcanBus , self ) . __init__ ( channel = channel , can_filters = can_filters , ** kwargs )
:param int channel:
            The Channel id to create this bus with.

        :param list can_filters:
            See :meth:`can.BusABC.set_filters`.

        Backend Configuration

        :param int bitrate:
            Channel bitrate in bit/s.
            Default is 500000.

        :param int device_number:
            The device number of the USB-CAN.
            Valid values: 0 through 254. Special value 255 is reserved to detect the first connected device (should only
            be used, in case only one module is connected to the computer).
            Default is 255.

        :param can.bus.BusState state:
            BusState of the channel.
            Default is ACTIVE.

        :param bool receive_own_messages:
            If messages transmitted should also be received back.
            Default is False.

        :param int rx_buffer_entries:
            The maximum number of entries in the receive buffer.
            Default is 4096.

        :param int tx_buffer_entries:
            The maximum number of entries in the transmit buffer.
            Default is 4096.

        :raises ValueError:
            If invalid input parameter were passed.

        :raises can.CanError:
            If hardware or CAN interface initialization failed.