code: def buildProtocol(self, addr):
          
          self.resetDelay()  # reset reconnection backoff state
          clargs = self.client_args.copy()
  
          # optionally configure antennas from self.antenna_dict, which looks
          # like {'10.0.0.1:5084': {'1': 'ant1', '2': 'ant2'}}
          hostport = '{}:{}'.format(addr.host, addr.port)
          logger.debug('Building protocol for %s', hostport)
          if hostport in self.antenna_dict:
              clargs['antennas'] = [
                  int(x) for x in self.antenna_dict[hostport].keys()]
          elif addr.host in self.antenna_dict:
              clargs['antennas'] = [
                  int(x) for x in self.antenna_dict[addr.host].keys()]
          logger.debug('Antennas in buildProtocol: %s', clargs.get('antennas'))
  
          logger.debug('%s start_inventory: %s', hostport,
                       clargs.get('start_inventory'))
          if self.start_first and not self.protocols:
              # this is the first protocol, so let's start it inventorying
              clargs['start_inventory'] = True
          proto = LLRPClient(factory=self, **clargs)
  
          # register state-change callbacks with new client
          for state, cbs in self._state_callbacks.items():
              for cb in cbs:
                  proto.addStateCallback(state, cb)
  
          # register message callbacks with new client
          for msg_type, cbs in self._message_callbacks.items():
              for cb in cbs:
                  proto.addMessageCallback(msg_type, cb)
  
          return proto
docs: Get a new LLRP client protocol object.
  
          Consult self.antenna_dict to look up antennas to use.