Setting the Science Sleep Switch
Function table
__IDO_FUNCTABLE__.funcTable35Model.setScientificSleepSwitch
Description of scientific sleep switch model
- IDOSetV3ScientificSleepModel
Parameter | Description | Remark |
---|---|---|
mode | Mode | bool yes is scientific sleep no is normal sleep |
startHour | Start hour | int |
startMinute | Start minute | int |
endHour | Finish hour | int |
endMinute | Finish minute | int |
Command code
Objc:
IDOSetV3ScientificSleepModel * model = [IDOSetV3ScientificSleepModel currentModel];
[IDOFoundationCommand setScientificSleepCommand:model
callback:^(int errorCode) {
if (errorCode == 0) {
//Set successfully
}else if (errorCode == 6) {
//Device not supported
}else {
//Setup failed
}
}];
Swift:
let model = IDOSetV3ScientificSleepModel.current();
IDOFoundationCommand.setScientificSleep(model) { (errorCode) in
if errorCode == 0 {
//Set successfully
}else if errorCode == 6{
//Device does not support this method
}else {
//Wrong setting
}
};