ACTimerManager Class Reference
Inherits from | NSObject |
---|---|
Declared in | ACTimerManager.h |
– addTaskWithDeviceId:name:timePoint:timeCycle:deviceMsg:OnType:callback:
创建定时任务
- (void)addTaskWithDeviceId:(NSInteger)deviceId name:(NSString *)name timePoint:(NSString *)timePoint timeCycle:(NSString *)timeCycle deviceMsg:(ACDeviceMsg *)deviceMsg OnType:(NSInteger)ontype callback:(void ( ^ ) ( NSError *error ))callback
Parameters
deviceId |
设备id(这里的id,是调用list接口返回的id,不是制造商提供的id) |
---|---|
timePoint |
任务时间点,时间格式为:"yyyy-MM-dd HH:mm:ss",比如2015-08-08 16:39:03 |
timeCycle |
单次定时任务:once 循环定时任务:按分重复:min 按小时重复:hour 按天重复:day 按月重复:month 按年复复:year 星期循环任务:week[0,1,2,3,4,5,6]如周一,周五重复,则表示为week[1,5] |
callback |
返回结果的监听回调 |
msg |
具体的消息内容 |
onType |
0:云端定时 1:设备定时 |
Declared In
ACTimerManager.h
– modifyTaskWithDeviceId:taskId:name:timePoint:timeCycle:deviceMsg:callback:
修改定时任务
- (void)modifyTaskWithDeviceId:(NSInteger)deviceId taskId:(NSInteger)taskId name:(NSString *)name timePoint:(NSString *)timePoint timeCycle:(NSString *)timeCycle deviceMsg:(ACDeviceMsg *)deviceMsg callback:(void ( ^ ) ( NSError *error ))callback
Parameters
deviceId |
设备id(这里的id,是调用list接口返回的id,不是制造商提供的id) |
---|---|
taskId |
任务id |
timePoint |
任务时间点,时间格式为:"yyyy-MM-dd HH:mm:ss",比如2015-08-08 16:39:03 |
timeCycle |
单次定时任务:once 循环定时任务:按分重复:min 按小时重复:hour 按天重复:day 按月重复:month 按年复复:year 星期循环任务:week[0,1,2,3,4,5,6]如周一,周五重复,则表示为week[1,5] |
callback |
返回结果的监听回调 |
msg |
具体的消息内容 |
Declared In
ACTimerManager.h
– openTaskWithDeviceId:taskId:callback:
开启定时任务
- (void)openTaskWithDeviceId:(NSInteger)deviceId taskId:(NSInteger)taskId callback:(void ( ^ ) ( NSError *error ))callback
Parameters
deviceId |
设备id(这里的id,是调用list接口返回的id,不是制造商提供的id) |
---|---|
taskId |
任务id |
callback |
返回结果的监听回调 |
Declared In
ACTimerManager.h
– closeTaskWithDeviceId:taskId:callback:
关闭定时任务
- (void)closeTaskWithDeviceId:(NSInteger)deviceId taskId:(NSInteger)taskId callback:(void ( ^ ) ( NSError *error ))callback
Parameters
deviceId |
设备id(这里的id,是调用list接口返回的id,不是制造商提供的id) |
---|---|
taskId |
任务id |
callback |
返回结果的监听回调 |
Declared In
ACTimerManager.h
– deleteTaskWithDeviceId:taskId:callback:
删除定时任务
- (void)deleteTaskWithDeviceId:(NSInteger)deviceId taskId:(NSInteger)taskId callback:(void ( ^ ) ( NSError *error ))callback
Parameters
deviceId |
设备id(这里的id,是调用list接口返回的id,不是制造商提供的id) |
---|---|
taskId |
任务id |
callback |
返回结果的监听回调 |
Declared In
ACTimerManager.h
– listTasksWithDeviceId:callback:
获取定时任务列表
- (void)listTasksWithDeviceId:(NSInteger)deviceId callback:(void ( ^ ) ( NSArray *timerTaskArray , NSError *error ))callback
Parameters
deviceId |
设备id(这里的id,是调用list接口返回的id,不是制造商提供的id) |
---|---|
callback |
返回结果的监听回调 |
Declared In
ACTimerManager.h