docs: def parseCapabilities(self, capdict):
          """Parse a capabilities dictionary and adjust instance settings.
  
          At the time this function is called, the user has requested some
          settings (e.g., mode identifier), but we haven't yet asked the reader
          whether those requested settings are within its capabilities. This
          function's job is to parse the reader's capabilities, compare them
          against any requested settings, and raise an error if there are any
          incompatibilities.
  
          Sets the following instance variables:
          - self.antennas (list of antenna numbers, e.g., [1] or [1, 2])
          - self.tx_power_table (list of dBm values)
          - self.reader_mode (dictionary of mode settings, e.g., Tari)
  
          Raises ReaderConfigurationError if the requested settings are not
          within the reader's capabilities.
          """
          # check requested antenna set
          gdc = capdict['GeneralDeviceCapabilities']
          max_ant = gdc['MaxNumberOfAntennaSupported']
          if max(self.antennas) > max_ant:
              reqd = ','.join(map(str, self.antennas))
              avail = ','.join(map(str, range(1, max_ant + 1)))
              errmsg = ('Invalid antenna set specified: requested={},'
                        ' available={}; ignoring invalid antennas'.format(
                            reqd, avail))
              raise ReaderConfigurationError(errmsg)
          logger.debug('set antennas: %s', self.antennas)
  
          # parse available transmit power entries, set self.tx_power
          bandcap = capdict['RegulatoryCapabilities']['UHFBandCapabilities']
          self.tx_power_table = self.parsePowerTable(bandcap)
          logger.debug('tx_power_table: %s', self.tx_power_table)
          self.setTxPower(self.tx_power)
  
          # parse list of reader's supported mode identifiers
          regcap = capdict['RegulatoryCapabilities']
          modes = regcap['UHFBandCapabilities']['UHFRFModeTable']
          mode_list = [modes[k] for k in sorted(modes.keys(), key=natural_keys)]
  
          # select a mode by matching available modes to requested parameters
          if self.mode_identifier is not None:
              logger.debug('Setting mode from mode_identifier=%s',
                           self.mode_identifier)
              try:
                  mode = [mo for mo in mode_list
                          if mo['ModeIdentifier'] == self.mode_identifier][0]
                  self.reader_mode = mode
              except IndexError:
                  valid_modes = sorted(mo['ModeIdentifier'] for mo in mode_list)
                  errstr = ('Invalid mode_identifier; valid mode_identifiers'
                            ' are {}'.format(valid_modes))
                  raise ReaderConfigurationError(errstr)
  
          # if we're trying to set Tari explicitly, but the selected mode doesn't
          # support the requested Tari, that's a configuration error.
          if self.reader_mode and self.tari:
              if self.reader_mode['MinTari'] < self.tari < self.reader_mode['MaxTari']:
                  logger.debug('Overriding mode Tari %s with requested Tari %s',
                               self.reader_mode['MaxTari'], self.tari)
              else:
                  errstr = ('Requested Tari {} is incompatible with selected '
                            'mode {}'.format(self.tari, self.reader_mode))
  
          logger.info('using reader mode: %s', self.reader_mode)