private async Task ReadDataAsync()

in DataStreamerAppServiceUWPCommSample/DataStreamerAppServiceUWPCommSample/App.xaml.cs [204:224]


		private async Task<ValueSet> ReadDataAsync()
		{
			if (DataStreamerConnection == null)
			{
				throw new ObjectDisposedException(nameof(DataStreamerConnection));
			}

			// Let's ask the DataStreamer for data
			ValueSet message = new ValueSet();
			AppServiceResponse response = null;

			message.Add("Command", "Read");
			response = await DataStreamerConnection.SendMessageAsync(message);

			if (response?.Status != AppServiceResponseStatus.Success)
			{
				throw new Exception($"Failed to send data: {response.Status.ToString()}");
			}

			return response.Message;
		}