Closed steveb48 closed 8 years ago
PowerState is based on boolean and brightnessState is based on int but they both call changeLightIntensity which accepts int. I think you want something like changePowerState which accepts booleans.
boolCharacteristics *powerState = new boolCharacteristics(charType_on, premission_read|premission_write|premission_notify); powerState->setValue("true"); powerState->valueChangeFunctionCall = &changeLightIntensity; lightAcc->addCharacteristics(lightService, powerState);
intCharacteristics *brightnessState = new intCharacteristics(charType_brightness, premission_read|premission_write|premission_notify, 0, 100, 1, unit_percentage); brightnessState->setValue("50"); brightnessState->valueChangeFunctionCall = &changeLightIntensity; lightAcc->addCharacteristics(lightService, brightnessState);
Looks like this is fixed now. Thanks!
PowerState is based on boolean and brightnessState is based on int but they both call changeLightIntensity which accepts int. I think you want something like changePowerState which accepts booleans.
boolCharacteristics *powerState = new boolCharacteristics(charType_on, premission_read|premission_write|premission_notify); powerState->setValue("true"); powerState->valueChangeFunctionCall = &changeLightIntensity; lightAcc->addCharacteristics(lightService, powerState);