Last change
on this file since 894d833 was
894d833,
checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago
|
#942 add command type to POST /schedule/create
Pass idcomando as task_id.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[83b242c] | 1 | #ifndef _OG_SCHEDULE_H_ |
---|
| 2 | #define _OG_SCHEDULE_H_ |
---|
| 3 | |
---|
| 4 | #include <stdint.h> |
---|
| 5 | #include "dbi.h" |
---|
| 6 | #include "list.h" |
---|
| 7 | #include <ev.h> |
---|
| 8 | |
---|
| 9 | struct og_schedule_time { |
---|
| 10 | uint32_t years; |
---|
| 11 | uint32_t months; |
---|
| 12 | uint32_t weeks; |
---|
| 13 | uint32_t week_days; |
---|
| 14 | uint32_t days; |
---|
| 15 | uint32_t hours; |
---|
| 16 | uint32_t am_pm; |
---|
| 17 | uint32_t minutes; |
---|
| 18 | }; |
---|
| 19 | |
---|
[63c4ea5] | 20 | enum og_schedule_type { |
---|
| 21 | OG_SCHEDULE_TASK, |
---|
[894d833] | 22 | OG_SCHEDULE_COMMAND, |
---|
[63c4ea5] | 23 | }; |
---|
| 24 | |
---|
[83b242c] | 25 | struct og_schedule { |
---|
| 26 | struct list_head list; |
---|
| 27 | struct ev_timer timer; |
---|
| 28 | time_t seconds; |
---|
| 29 | unsigned int task_id; |
---|
| 30 | unsigned int schedule_id; |
---|
[63c4ea5] | 31 | enum og_schedule_type type; |
---|
[83b242c] | 32 | }; |
---|
| 33 | |
---|
| 34 | void og_schedule_create(unsigned int schedule_id, unsigned int task_id, |
---|
[63c4ea5] | 35 | enum og_schedule_type type, |
---|
[83b242c] | 36 | struct og_schedule_time *time); |
---|
| 37 | void og_schedule_update(struct ev_loop *loop, unsigned int schedule_id, |
---|
| 38 | unsigned int task_id, struct og_schedule_time *time); |
---|
| 39 | void og_schedule_delete(struct ev_loop *loop, uint32_t schedule_id); |
---|
| 40 | void og_schedule_next(struct ev_loop *loop); |
---|
| 41 | void og_schedule_refresh(struct ev_loop *loop); |
---|
[894d833] | 42 | void og_schedule_run(unsigned int task_id, unsigned int schedule_id, |
---|
| 43 | enum og_schedule_type type); |
---|
[83b242c] | 44 | |
---|
| 45 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.