i would split it into chunks.
if u find GetTemperature find start / end behind this key word.
this block read response, read send:
read exitcode, read structure name, find start end, read key values for this structure into a map.
so each sub get a piece of data for processing and return his result in a more handy form.