public GalileoStatus GetCurrentStatus() { byte[] currentStatus = new byte[1024 * 1024]; long length = 0; if (GalileoFunctions.GetCurrentStatus(instance, currentStatus, ref length) != GALILEO_RETURN_CODE.OK) { return(null); } string currentStatusJsonString = Encoding.UTF8.GetString(currentStatus, 0, (int)length); return(JsonConvert.DeserializeObject <GalileoStatus>(currentStatusJsonString)); }