public static async Task <MavParam> WriteParam(this IMavlinkParameterClient src, string name, long value, CancellationToken cancel) { MavParam param; if (!src.Params.TryGetValue(name, out param)) { param = await src.ReadParam(name, cancel).ConfigureAwait(false); } return(await src.WriteParam(new MavParam(param, value), cancel).ConfigureAwait(false)); }
public static async Task <MavParam> GetOrReadFromVehicleParam(this IMavlinkParameterClient src, string name, CancellationToken cancel) { MavParam value; if (src.Params.TryGetValue(name, out value)) { return(value); } var param = await src.ReadParam(name, DefaultAttemptCount, cancel).ConfigureAwait(false); return(param); }
public static Task <MavParam> ReadParam(this IMavlinkParameterClient src, short index, CancellationToken cancel) { return(src.ReadParam(index, DefaultAttemptCount, cancel)); }