async void SetBrightnessLevel(double brightness) { // Convert from 0.0 - 1.0 to 0 - 100 and invoke consumer method var result = await m_Consumer.SetBrightnessAsync((uint)(brightness * 100.0)); if (result.Status != AllJoynStatus.Ok) { throw new InvalidOperationException("SetBrightness failed with code " + result.Status); } }