public async Task <IIpcResponse> SendMessageAsync(string command) { var message = new IpcMessage(command); var messageJson = JsonConvert.SerializeObject(message); var responseJson = await _ipcClient.SendAsync(messageJson); return(JsonConvert.DeserializeObject <IpcResponse>(responseJson)); }
/// <summary> /// Claim control. After this (obviously awaited) you can control a connected device. /// </summary> public async Task ClaimControl() { await _ipcClient.SendAsync(new IpcMessage(IpcMessageCode.ClaimControl)).ConfigureAwait(false); HasControl = true; }