def parse_response_data(layer, fields):
 layer = layer[4:]
 response = []
 for i in xrange(fields):
  ltxt = int(layer[0], 16)
  text = ''.join(layer[1:(ltxt + 1)]).decode('hex')
  response.append(text)
  layer = layer[(ltxt + 1):]
 return response

def parse_response_data ( layer , fields ) : layer = layer [ 4 : ] response = [ ] for i in xrange ( fields ) : ltxt = int ( layer [ 0 ] , 16 ) text = '' . join ( layer [ 1 : ( ltxt + 1 ) ] ) . decode ( 'hex' ) response . append ( text ) layer = layer [ ( ltxt + 1 ) : ] return response
parse the data from a response .