def get_next_invoke_id(self, addr):
        if _debug: StateMachineAccessPoint._debug("get_next_invoke_id")

        initialID = self.nextInvokeID
        while 1:
            invokeID = self.nextInvokeID
            self.nextInvokeID = (self.nextInvokeID + 1) % 256

            # see if we've checked for them all
            if initialID == self.nextInvokeID:
                raise RuntimeError("no available invoke ID")

            for tr in self.clientTransactions:
                if (invokeID == tr.invokeID) and (addr == tr.remoteDevice.address):
                    break
            else:
                break

        return invokeID
If routers is not specified, will default to settings.DATABASE_ROUTERS.
dataset/ETHPy150Open JoelBender/bacpypes/py25/bacpypes/appservice.py/StateMachineAccessPoint.get_next_invoke_id--crossover with--dataset/ETHPy150Open django/django/django/db/utils.py/ConnectionRouter.__init__