libnx
time.h
Go to the documentation of this file.
1 /**
2  * @file time.h
3  * @brief Time services IPC wrapper.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 
9 #include "../types.h"
10 #include "../services/sm.h"
11 
12 /// Time clock type.
13 typedef enum {
14  TimeType_UserSystemClock,
15  TimeType_NetworkSystemClock,
16  TimeType_LocalSystemClock,
17  TimeType_Default = TimeType_NetworkSystemClock,
18 } TimeType;
19 
20 Result timeInitialize(void);
21 void timeExit(void);
22 
23 Service* timeGetSessionService(void);
24 
25 Result timeGetCurrentTime(TimeType type, u64 *timestamp);
26 
27 /**
28  * @brief Sets the time for the specified clock.
29  * @param[in] type Clock to use.
30  * @param[in] timestamp POSIX UTC timestamp.
31  * @return Result code.
32  */
33 Result timeSetCurrentTime(TimeType type, u64 timestamp);
Service object structure.
Definition: sm.h:23
u32 Result
Function error code result type.
Definition: types.h:46
uint64_t u64
64-bit unsigned integer.
Definition: types.h:24
Result timeSetCurrentTime(TimeType type, u64 timestamp)
Sets the time for the specified clock.
TimeType
Time clock type.
Definition: time.h:13