#include #include "../include/uhppoted.hpp" #include "examples.hpp" using namespace std; void addTask(uhppoted &u, int argc, char **argv) { auto options = parse(argc, argv); uint32_t deviceID = options.device_id; task task = { .task = 6, .door = 4, .from = "2022-02-01", .to = "2022-06-30", .monday = true, .tuesday = false, .wednesday = true, .thursday = true, .friday = false, .saturday = false, .sunday = true, .at = "08:30", .cards = 11, }; u.add_task(deviceID, task); vector fields = { field("ID", deviceID), field("task", task.task), field("door", task.door), field("enabled from", task.from), field(" to", task.to), field("enabled on Monday", task.monday), field(" Tuesday", task.tuesday), field(" Wednesday", task.wednesday), field(" Thursday", task.thursday), field(" Friday", task.friday), field(" Saturday", task.saturday), field(" Sunday", task.sunday), field(" run at", task.at), field("cards", task.cards), }; display("add-task", fields); } void refreshTaskList(uhppoted &u, int argc, char **argv) { auto options = parse(argc, argv); uint32_t deviceID = options.device_id; u.refresh_tasklist(deviceID); vector fields = { field("ID", deviceID), }; display("refresh-tasklist", fields); } void clearTaskList(uhppoted &u, int argc, char **argv) { auto options = parse(argc, argv); uint32_t deviceID = options.device_id; u.clear_tasklist(deviceID); vector fields = { field("ID", deviceID), }; display("clear-tasklist", fields); }