private string ParseResponse(byte[] buffer) { var pos = 0; var header = Encoding.UTF8.GetString(buffer, pos, 4); buffer = buffer.Skip(5).ToArray(); if (header == "RPOS") // Ignore other messages { RPOS rpos = ByteArrayToStructure <RPOS>(buffer); return(rpos.ToString()); } return(null); }