From 4bd08f0355b6b2cf3c027202d5ad301b4e182953 Mon Sep 17 00:00:00 2001 From: yy1717 <fctom1215@outlook.com> Date: 星期五, 31 三月 2023 17:16:22 +0800 Subject: [PATCH] 科目二修改 --- lib/src/main/cpp/utils/xconvert.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/lib/src/main/cpp/utils/xconvert.h b/lib/src/main/cpp/utils/xconvert.h index 27e0bdd..1656e79 100644 --- a/lib/src/main/cpp/utils/xconvert.h +++ b/lib/src/main/cpp/utils/xconvert.h @@ -9,6 +9,18 @@ #include <string> #include <vector> +struct TimeStructure +{ + uint8_t Second; /* seconds after the minute [0, 59] */ + uint8_t Minute; /* minutes after the hour [0, 59 ] */ + uint8_t Hour; /* hours since midnight [0, 23] */ + uint8_t Day; /* day of the month [1, 31] */ + uint8_t Month; /* month of the year [1, 12] */ + uint16_t Year; /* years since Christ born [0, lots] */ + uint8_t Wday; /* days since Sunday [0, 6] */ + uint16_t Yday; /* days since January 1 [0, 365] */ +}; + double ConvertKMh2Ms(int kmh); double ConvertMs2KMh(double ms); @@ -16,6 +28,7 @@ void ConvertHex2String(char *str, const uint8_t *hex, int length); void ConvertString2Hex(uint8_t *hex, int length, const char *str); uint32_t TimeMakeComposite(int year, int month, int day, int hour, int minute, int second); +void TimeBreakdown(uint32_t SecondsSince1970 , struct TimeStructure *pTS); uint32_t TimeMakeComposite(int hour, int minute, int second, int msecond); uint32_t TimeGetDiff(int hour1, int minute1, int second1, int msecond1, int hour2, int minute2, int second2, int msecond2); -- Gitblit v1.8.0