Set time command
Time Model Description
- IDOSetTimeInfoBluetoothModel
Parameter | Description | Remark |
---|---|---|
year | Year | int |
month | Month | int |
day | Day | int |
hour | Hour | int |
minute | Minute | int |
second | Second | int |
weekDay | Wekk | int |
timeZone | Timezone | 1-24 Function table in table 36 =>timeZoneFloat if supported Timezone*100 foe example:8.10*100 = 810 |
timeStamp | Timestamp | str |
Command code
Objc:
//Get current time
IDOSetTimeInfoBluetoothModel * model = [IDOSetTimeInfoBluetoothModel currentModel];
//Get UTC time
if(__IDO_FUNCTABLE__.funcTable28Model.utcTimeZone) {
IDOSetTimeInfoBluetoothModel * model = [IDOSetTimeInfoBluetoothModel getCurrentUtcTimeModel];
}
[IDOFoundationCommand setCurrentTimeCommand:model
callback:^(int errorCode) {
if(errorCode == 0) {
//Set successfully
}else if (errorCode == 6) {
//Device does not support this method
}else {
//Wrong setting
}
}];
Swift:
let model1:IDOSetTimeInfoBluetoothModel = IDOSetTimeInfoBluetoothModel.current();
if IDOBluetoothEngine.shareInstance().managerEngine.funcTableModel.funcTable28Model.utcTimeZone {
let model:IDOSetTimeInfoBluetoothModel = IDOSetTimeInfoBluetoothModel.getCurrentUtcTime();
}
IDOFoundationCommand.setCurrentTime(model) { (errorCode) in
if errorCode == 0 {
//Set successfully
}else if errorCode == 6{
//Device does not support this method
}else {
//Wrong setting
}
};