SingingCat 0
application
sc_time.h
1#ifndef SC_TIME_H
2#define SC_TIME_H
3#include "sctime.h" // user-include
4#include "command.h"
5void sctime_init(); //call once at boot
6void check_time_on_loop();
7int time_command_received(struct command *com);
8// 0 if ok
9int get_localtime_as_struct(struct sctime *time);
10// add seconds to a timestamp (like golangs time.Add(...))
11uint32_t add_seconds(uint32_t t, uint32_t offset);
12// given a timestamp, convert it to a timestruct
13void convert_timestamps_to_time(uint32_t bcdtime, uint32_t bcddate, struct sctime *time);
14// given a timestruct, convert to timestamp
15uint32_t convert_time_to_timestamp(struct sctime *time);
16// send a sync request to server to get current time
17void send_clock_sync_request();
18void clocksync_enable(uint8_t);
19// add some debug information to a command
20void time_add_debug_to_command(struct command *com);
21// get the seconds since application was started. (as supposed to mculib ...since_boot() which refers to pcb powerup)
22uint32_t get_seconds_since_start();
23// print help, current config about time
24void clocksync_help();
25// return seconds between time1 and time2
26int diff_time(struct sctime *time1, struct sctime *time2);
27
28#endif
Definition: sctime.h:3