public override System.String ToString() { IntPtr strptr; ossia_preset_result_enum code = BlueYetiAPI.ossia_presets_to_string(preset, &strptr); if (code == ossia_preset_result_enum.OSSIA_PRESETS_OK) { System.String str = Marshal.PtrToStringAuto(strptr); BlueYetiAPI.ossia_preset_free_string(strptr); return(str); } else { throw new Exception("Error code " + code); } }
public string WriteJson(string device) { IntPtr ptr; ossia_preset_result_enum code = BlueYetiAPI.ossia_presets_write_json(preset, device, out ptr); if (code == ossia_preset_result_enum.OSSIA_PRESETS_OK) { string str = Marshal.PtrToStringAuto(ptr); Debug.Log("Wrote json \"" + str + "\""); BlueYetiAPI.ossia_preset_free_string(ptr); return(str); } else { throw new Exception("Error code " + code); } }