public static AdapterInterface CreateBrightness(double currentValue, Action<double> onBrightnessChanged)
{
var iface = new AdapterInterface("org.alljoyn.SmartSpaces.Operation.Brightness");
iface.Properties.Add(new AdapterAttribute("Version", (ushort)1) { COVBehavior = SignalBehavior.Never });
iface.Properties[0].Annotations.Add("org.alljoyn.Bus.DocString.En", "The interface version");
iface.Properties.Add(new AdapterAttribute("Brightness", currentValue, (value) =>
{
if (!(value is double))
return AllJoynStatusCode.BUS_BAD_VALUE_TYPE;
double brightness = (double)value;
if (brightness < 0 || brightness > 1)
return AllJoynStatusCode.BUS_BAD_VALUE;
onBrightnessChanged(brightness);
return AllJoynStatusCode.Ok;
}) { COVBehavior = SignalBehavior.Always });
iface.Properties[1].Annotations.Add("org.alljoyn.Bus.DocString.En", "Brightness of the device.");
return iface;
}
/*