def startService(self):
        connection = self.options['connection']
        try:
            if connection.get_type() == "serial":
                _kwargs = connection.params
                _kwargs['protocol'] = self._protocol
                _kwargs['reactor'] = reactor

                # rename port's argument
                if _kwargs in "port":
                    _kwargs['deviceNameOrPortNumber'] = _kwargs['port']
                    del _kwargs['port']

                self._router_device = SerialPort(**_kwargs)
        except:
            self.log.error(NetworkRouterConnectFailure(self.options))
            self._reconnect_nums += 1
            self._reconnect_callid = reactor.callLater(
                self._reconnect_nums * self.RECONNECT_DELAY, self.startService)
            return

        self._litemq = get_service_named("litemq")
        self._litemq.consume(
            exchange="network",
            queue="routing.out." + self.name,
            routing_key="transport->routing",
            callback=self.outsegment_mqcallback
        )

        SAMultiService.startService(self)
dataset/ETHPy150Open smartanthill/smartanthill1_0/smartanthill/network/service.py/RouterService.startService/swapped operands of `in`