code: def decode_param(data):
      
      logger.debug('decode_param data: %r', data)
      header_len = struct.calcsize('!HH')
      partype, parlen = struct.unpack('!HH', data[:header_len])
  
      pardata = data[header_len:parlen]
      logger.debug('decode_param pardata: %r', pardata)
  
      ret = {
          'Type': partype,
      }
  
      if partype == 1023:
          vsfmt = '!II'
          vendor, subtype = struct.unpack(vsfmt, pardata[:struct.calcsize(vsfmt)])
          ret['Vendor'] = vendor
          ret['Subtype'] = subtype
          ret['Data'] = pardata[struct.calcsize(vsfmt):]
      else:
          ret['Data'] = pardata,
  
      return ret, data[parlen:]
docs: Decode any parameter to a byte sequence.
  
      :param data: byte sequence representing an LLRP parameter.
      :returns dict, bytes: where dict is {'Type': <decoded type>, 'Data':
          <decoded data>} and bytes is the remaining bytes trailing the bytes we
          could decode.