diff options
Diffstat (limited to 'stub/clock')
-rw-r--r-- | stub/clock/LICENSE | 177 | ||||
-rw-r--r-- | stub/clock/Makefile.client | 19 | ||||
-rw-r--r-- | stub/clock/client_clock/Makefile | 45 | ||||
-rw-r--r-- | stub/clock/client_clock/include/stub/Clock_API.h | 503 | ||||
-rw-r--r-- | stub/clock/client_clock/include/stub/clock_clock.h | 41 | ||||
-rw-r--r-- | stub/clock/client_clock/libClock_API.ver | 29 | ||||
-rw-r--r-- | stub/clock/client_clock/src/Clock_API.cpp | 118 | ||||
-rw-r--r-- | stub/clock/client_display_time/Makefile | 47 | ||||
-rw-r--r-- | stub/clock/client_display_time/include/stub/DTime_Api.h | 916 | ||||
-rw-r--r-- | stub/clock/client_display_time/include/stub/clock_display_time.h | 42 | ||||
-rw-r--r-- | stub/clock/client_display_time/include/stub/clock_notifications.h | 46 | ||||
-rw-r--r-- | stub/clock/client_display_time/libDTime_Api.ver | 31 | ||||
-rw-r--r-- | stub/clock/client_display_time/src/DTime_Api.cpp | 246 | ||||
-rw-r--r-- | stub/clock/localtime/Makefile | 49 | ||||
-rw-r--r-- | stub/clock/localtime/zoneinfo_base | 232 |
15 files changed, 2541 insertions, 0 deletions
diff --git a/stub/clock/LICENSE b/stub/clock/LICENSE new file mode 100644 index 00000000..f433b1a5 --- /dev/null +++ b/stub/clock/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/stub/clock/Makefile.client b/stub/clock/Makefile.client new file mode 100644 index 00000000..e4696332 --- /dev/null +++ b/stub/clock/Makefile.client @@ -0,0 +1,19 @@ +# +# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +SUBDIRS := client_clock client_display_time + +include ../stub.mk diff --git a/stub/clock/client_clock/Makefile b/stub/clock/client_clock/Makefile new file mode 100644 index 00000000..9124b7d9 --- /dev/null +++ b/stub/clock/client_clock/Makefile @@ -0,0 +1,45 @@ +# +# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +######### installed shared library(*.so) ############# +INST_SHLIBS = libClock_API + +######### install headers(*.h) ############# +INST_HEADERS = Clock_API.h clock_clock.h + +######### compiled sources ############# +libClock_API_SRCS = Clock_API.cpp + +######### add source path ############# +VPATH += ./src ./include/stub + +######### add include path ############# +CPPFLAGS += -I./include + +######### add compile option ############# +LDFLAGS += -Wl,--no-undefined +LDFLAGS += -Wl,--no-as-needed + +CPPFLAGS += -Werror=implicit-function-declaration +CPPFLAGS += -Werror=format-security +CPPFLAGS += -Wconversion +CPPFLAGS += -Wint-to-pointer-cast +CPPFLAGS += -Wpointer-arith +CPPFLAGS += -Wformat + +######### linked library (dynamic) ############# + +include ../../stub.mk diff --git a/stub/clock/client_clock/include/stub/Clock_API.h b/stub/clock/client_clock/include/stub/Clock_API.h new file mode 100644 index 00000000..375354e3 --- /dev/null +++ b/stub/clock/client_clock/include/stub/Clock_API.h @@ -0,0 +1,503 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file Clock_API.h + * @brief System community functions header file. + */ + +/******************************************************************************* +* $Header:: $ +* $Revision:: $ +*******************************************************************************/ + + /****************************************************************************** + * file name : Clock_API.h + * system name : PND-A + * sub system name : system common function group header file + * program name : +****************************************************************************/ +#ifndef CLOCK_CLIENT_CLOCK_INCLUDE_VEHICLE_SERVICE_CLOCK_API_H_ +#define CLOCK_CLIENT_CLOCK_INCLUDE_VEHICLE_SERVICE_CLOCK_API_H_ + +#include <time.h> + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup clock + * @ingroup vehicle_service + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \~english The time corrected by GPS. + */ +#define CLOCK_CORRECTED_TIME (0U) + +/** + * \~english The time not corrected by GPS. + */ +#define CLOCK_NOT_CORRECTED_TIME (1U) + +/** + * \~english The time synchronized by GPS RTC. + */ +#define CLOCK_RTC_TIME (2U) + +/** + * \~english GPS time error. + */ +#define CLOCK_INVALID_TIME (3U) + +/** + * \~english The max size memory for time zone. + */ +#define TIME_ZONE_MAX_SIZE 256 + +/** + * \~english Return value define. + */ +typedef enum tagCLOCK_RETURN { + CLOCK_OK, //!< \~english Return successful + CLOCK_ERROR, //!< \~english Return failed + CLOCK_ERROR_ARGUMENTS //!< \~english Arguments error +} CLOCK_RETURN; +/* + data type definition +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + \~english API function prototype defined +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * \ingroup Clock_getSystemTime + * \~english @par Brief + * - Get the system time. + * \~english @param [out] time Store system time data + * \~english @param [out] status Store time data status\n + * Time status:\n + * Valid time : CLOCK_CORRECTED_TIME\n + * Invalid time: CLOCK_INVALID_TIME\n + * NOTE:When can't communication with Clock service, return "CLOCK_INVALID_TIME" + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - The argument used for store system time data is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The argument used for store time data status is NULL. [CLOCK_ERROR_ARGUMENTS] + * - Get system time error. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return after call end), please check it when used the API. + * - Call this API to get the system time and status. + * - NOTE:Local time can be got by calling Clock_getLocalTime which parameter is the result of this API. + * - The time returned by calling this API is UTC time, its range is from\n + * "1970-01-01 00:00:00" to "2038-01-19 03:14:07". + * - Clock_getSystemTimeY2K38 can be used to get time later than "2038-01-19 03:14:08". + * - Result : "System time and time status" to "System time and status" will be stored in arguments. + * \~english @see Clock_getLocalTime, Clock_getSystemTimeY2K38, McOpenSender,\n + * McCreateInvokerName, McOpenSyncReceiver, McInvokeSync + */ +CLOCK_RETURN Clock_getSystemTime(struct timespec* time, uint8_t* status); + +/** + * \ingroup Clock_getLocalTime + * \~english @par Brief + * - Get the local time. + * \~english @param [in] base_time Pointer to store base time(seconds) + * \~english @param [out] local_time Pointer to store local time + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - The argument used to store base time(seconds) is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The argument used to store local time is NULL. [CLOCK_ERROR_ARGUMENTS] + * - Get local time failed. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - Call this API to get local time. + * - The time returned by calling this API is UTC time, its range is from\n + * "1970-01-01 00:00:00" to "2038-01-19 03:14:07". + * - Clock_getSystemTimeY2K38 can be used to get time later than "2038-01-19 03:14:08". + * - Result : Local time will be stored in arguments. + * - tm which is changed base on base_time will be returned when the timezone is not set. + * \~english @see Clock_getSystemTime, Clock_getSystemTimeY2K38 + */ +CLOCK_RETURN Clock_getLocalTime(const time_t* base_time, struct tm* local_time); + +/** + * \ingroup Clock_CnvSecToDate + * \~english @par Brief + * - Convert specified elapsed seconds to date and time.\n + * The specified elapsed seconds are regarded as elapsed time from 1970/01/01 00:00:00. + * \~english @param [in] timep The pointer to store the seconds + * \~english @param [out] result The pointer to store date time + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - The pointer used to store the seconds from base date time is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The pointer used to store the date time is NULL. [CLOCK_ERROR_ARGUMENTS] + * - Convert the seconds from base date time to date time failed. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - Call this API to convert the seconds which is "1970-01-01 00:00:00" to date time. + * - The time returned by calling this API is UTC time, its range is from\n + * "1970-01-01 00:00:00" to "2038-01-19 03:14:07". + * - Clock_getSystemTimeY2K38 can be used to get time later than "2038-01-19 03:14:08". + * - Result :Convert the seconds to date time. The seconds is from "1970-01-01 00:00:00". + * \~english @see Clock_CnvDateToSec, Clock_CnvSecToDateY2K38 + */ +CLOCK_RETURN Clock_CnvSecToDate(const time_t* timep, struct tm *result); + +/** + * \ingroup Clock_CnvDateToSec + * \~english @par Brief + * - Convert specified date and time to elapsed seconds from 1970/01/01 00:00:00. + * \~english @param [in] tm The pointer to store date time to convert + * \~english @param [out] result The pointer to store seconds from base time + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - The pointer used to store the date time is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The pointer used to store the seconds from base date time is NULL. [CLOCK_ERROR_ARGUMENTS] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - Call this API to convert the seconds which from "1970-01-01 00:00:00" to date time. + * - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2038-01-19 03:14:07". + * - For more then "2038-01-19 03:14:08", please use Clock_CnvDateToSecY2K38. + * - Result : Convert date time to seconds from "1970-01-01 00:00:00". + * \~english @see Clock_CnvSecToDate, Clock_CnvDateToSecY2K38 + */ +CLOCK_RETURN Clock_CnvDateToSec(const struct tm* tm, time_t* result); + +/** + * \ingroup Clock_setUserTime + * \~english @par Brief + * - Set the display time when GPS synchronization setting is off. + * \~english @param [in] user_time The pointer to store the time(second from base time) + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - The pointer used to store the time from base date time is NULL. [CLOCK_ERROR_ARGUMENTS] + * - Get thread name of caller failed. [CLOCK_ERROR] + * - Get handle of Clock service message queue failed. [CLOCK_ERROR] + * - Generate message queue name for sync call failed. [CLOCK_ERROR] + * - Generate message queue for receiving failed. [CLOCK_ERROR] + * - Message sync communicate failed. [CLOCK_ERROR] + * - Message buffer received sync communicate message is error. [CLOCK_ERROR] + * - Clock service handle failed. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - This API called for user set time to user time when GPS corrected off. + * - Result : Set user time when GPS corrected off. + * \~english @see Clock_getUserTime, Clock_addUserTimeOffset, McOpenSender,\n + * McCreateInvokerName, McOpenSyncReceiver, McInvokeSync + */ +CLOCK_RETURN Clock_setUserTime(const time_t* user_time); + +/** + * \ingroup Clock_getUserTime + * \~english @par Brief + * - Get the display time when GPS synchronization setting is off. + * \~english @param [out] user_time The pointer to store the time(second from base time) + * \~english @param [out] status The pointer to store time status\n + * time status\n + * Valid time: CLOCK_CORRECTED_TIME\n + * Invalid time: CLOCK_INVALID_TIME\n + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When GPS corrected off, the pointer to store user time date is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The pointer to store time status is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The caller thread name get failed. [CLOCK_ERROR] + * - Get Clock service message queue handle failed. [CLOCK_ERROR] + * - Generate message queue name for sync call failed. [CLOCK_ERROR] + * - Generate message queue handle for sync call failed. [CLOCK_ERROR] + * - Message sync communicate failed. [CLOCK_ERROR] + * - Message buffer received sync communicate message is error. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - Call the API, can get the status for user time invalid or valid, when GPS corrected off. + * - Note : Get local time, use Clock_getLocalTIme with arguments.\n + * The API used to get user time when GPS corrected off. + * - Result : Get user time when GPS corrected off. + * \~english @see Clock_setUserTime, Clock_addUserTimeOffset, Clock_getLocalTime,\n + * McOpenSender, McCreateInvokerName, McOpenSyncReceiver, McInvokeSync + */ +CLOCK_RETURN Clock_getUserTime(time_t* user_time, uint8_t* status); + +/** + * \ingroup Clock_addUserTimeOffset + * \~english @par Brief + * - Adjust the display time when GPS synchronization setting is off. + * \~english @param [in] offset The pointer to store offset for add(sub) user time.\n + * Note : Member has limit as follow. \n + * int tm_hour: hour(-12 to 12)\n + * int tm_min : minute(-59 to 59)\n + * year, month, day, second and so on not used, please set 0. + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - The pointer to store offset for add(sub) user time is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_sec set second not 0. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_mday set day not 0. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_mon set month not 0. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_year set year not 0. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_wday set day in week not 0. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_yday set day in year not 0. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_isdst set daylight save time not 0. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_hour set hour bigger then 12. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_hour set hour smaller then -12. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_min set minute bigger then 59. [CLOCK_ERROR_ARGUMENTS] + * - The parameter offset->tm_min set minute smaller then -59. [CLOCK_ERROR_ARGUMENTS] + * - The caller thread name get failed. [CLOCK_ERROR] + * - Get Clock service message queue handle failed. [CLOCK_ERROR] + * - Generate message queue name for sync call failed. [CLOCK_ERROR] + * - Generate message queue handle for sync call failed. [CLOCK_ERROR] + * - Message sync communicate failed. [CLOCK_ERROR] + * - Clock service handle failed. [CLOCK_ERROR] + * - Message buffer received sync communicate message is error. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - The API used for add(sub) user time when user set GPS correct off. + * - Result : User time add(sub) offset when GPS correct off. + * \~english @see Clock_setUserTime, Clock_getUserTime, McOpenSender, McCreateInvokerName,\n + * McOpenSyncReceiver, McInvokeSync + */ +CLOCK_RETURN Clock_addUserTimeOffset(const struct tm* offset); + +/* Clock_getSystemTimeY2K38 can be used to get time later than "2038-01-19 03:14:08"(UTC). */ +/** + * \ingroup Clock_getSystemTimeY2K38 + * \~english @par Brief + * - Get the system time(2038 issue fixed). + * \~english @param [out] time Store system time data + * \~english @param [out] status Store time data status\n + * Time status:\n + * Valid time : CLOCK_CORRECTED_TIME\n + * Invalid time: CLOCK_INVALID_TIME\n + * Note : When can't communication with Clock service, return "CLOCK_INVALID_TIME". + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the storage area of the system time data is NULL. [CLOCK_ERROR_ARGUMENTS] + * - When the time data status storage area is NULL. [CLOCK_ERROR_ARGUMENTS] + * - In case of system time acquisition failure. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - Call the API, can get the status for system time invalid or valid. + * - Get local time, use Clock_getLocalTIme with arguments. The API used to get system time. + * - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2016-01-19 03:14:07". + * - Result : System time and time status will be stored in arguments. + * \~english @see Clock_getSystemTime, Clock_getLocalTimeY2K38, McOpenSender,\n + * McCreateInvokerName, McOpenSyncReceiver, McInvokeSync + */ +CLOCK_RETURN Clock_getSystemTimeY2K38(uint32_t* time, uint8_t* status); + +/** + * \ingroup Clock_getLocalTimeY2K38 + * \~english @par Brief + * - Get the local time(2038 issue fixed). + * \~english @param [in] base_time Pointer to store base time(seconds) + * \~english @param [out] local_time Pointer to store local time + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - The argument used to store base time(seconds) is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The argument used to store local time is NULL. [CLOCK_ERROR_ARGUMENTS] + * - The argument named base_time bigger then up limit(4293400447) of fixed 2038 issue. [CLOCK_ERROR_ARGUMENTS] + * - Get local time failed. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - Call this API to get local time. + * - Return local time by add time zone information to base time. + * - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2106-01-19 03:14:07". + * - The parameter base_time bigger then up limit(4293400447), convert error. + * - Also, this API does not support day of the week (Member tm_wday acquired always stores -1.)\n + * what the caller sought from year/nomth/data information. + * - Result : Local time will be stored in arguments. + * - If time zone not set, it will return change base_time type to tm + * \~english @see Clock_getLocalTime, Clock_getSystemTimeY2K38 + */ +CLOCK_RETURN Clock_getLocalTimeY2K38(const uint32_t* base_time, struct tm* local_time); + +/** + * \ingroup Clock_CnvSecToDateY2K38 + * \~english @par Brief + * - Convert specified elapsed seconds to date and time(2038 issue fixed).\n + * The specified elapsed seconds are regarded as elapsed time from 1970/01/01 00:00:00. + * \~english @param [in] time Pointer to the storage destination + * \~english @param [out] result Pointer to storage location of converted date/time + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR fail + * \~english @retval CLOCK_ERROR_ARGUMENTS arguments error + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the accumulated second storage area from the date conuting point to be converted is NULL.\n + * [CLOCK_ERROR_ARGUMENTS] + * - When the converted date/time storage area is NULL. [CLOCK_ERROR_ARGUMENTS] + * - When the regerence time (seconds) specified by the argument time is greater than\n + * the conuntermeasure upper limit value (4293400447) of the 2038 root problem. [CLOCK_ERROR_ARGUMENTS] + * - In case of a date/time conversion failure as a cumulative second from the specified date\n + * in the specified integration seconds. [CLOCK_ERROR] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - Call this API to convert the specified integration seconds to the date and\n + * time as the integration seconds from "1970-01-01 00:00:00" at the date conuting point. + * - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2106-01-19 03:14:07". + * - If the argument time exceeds the above upper limit(4293400447), it can not be converted properly. + * - Also, this API does not support day of the week (Member tm_wday acquired always stores -1.)\n + * what the caller sought from year/nomth/data information. + * - Result: Converts the specified integration seconds to the date and time\n + * as the integration seconds from "1970-01-01 00:00:00" at the date conuting point. + * \~english @see Clock_CnvSecToDate, Clock_CnvDateToSecY2K38 + */ +CLOCK_RETURN Clock_CnvSecToDateY2K38(const uint32_t* time, struct tm *result); + +/** + * \ingroup Clock_CnvDateToSecY2K38 + * \~english @par Brief + * - Convert specified date and time to elapsed seconds from 1970/01/01 00:00:00.(2038 issue fixed) + * \~english @param [in] tm Pointer to the storage location of the date and time to be converted. + * \~english @param [out] result Pointer to storage detination of accumulated seconds from date counting point. + * \~english @retval CLOCK_OK success + * \~english @retval CLOCK_ERROR_ARGUMENTS Invalide parameter + * \~english @par Prerequisite + * - Clock service's availability is TRUE. + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the date time storage area to be converted is NULL. [CLOCK_ERROR_ARGUMENTS] + * - When the accumulated second storage area from the date conuting point is NULL. [CLOCK_ERROR_ARGUMENTS] + * - When the conversion result (result) is greater than the conuntermeasure upper\n + * limit value (4293400447) of the 2038 root problem. [CLOCK_ERROR_ARGUMENTS] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - The API is sync(return before call end), please check it when used the API. + * - Call this API to convert the specified time to integration seconds from "1970-01-01 00:00:00"\n + * (date conuting point). + * - The API is used when UTC time is in the range from "1970-01-01 00:00:00" to "2106-01-19 03:14:07". + * - The maximum value of result that can be obtained is 4293400447(sec). + * - Result: Converts the specified date and time to integration seconds from "1970-01-01 00:00:00"\n + * (date counting point). + * \~english @see Clock_CnvDateToSec, Clock_CnvSecToDateY2K38 + */ +CLOCK_RETURN Clock_CnvDateToSecY2K38(const struct tm* tm, uint32_t* result); + +#ifdef __cplusplus +} +#endif // __cplusplus + +/** @}*/ // end of clock +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem + +#endif // CLOCK_CLIENT_CLOCK_INCLUDE_VEHICLE_SERVICE_CLOCK_API_H_ diff --git a/stub/clock/client_clock/include/stub/clock_clock.h b/stub/clock/client_clock/include/stub/clock_clock.h new file mode 100644 index 00000000..b1a1c99d --- /dev/null +++ b/stub/clock/client_clock/include/stub/clock_clock.h @@ -0,0 +1,41 @@ +/* + * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file clock_clock.h + * @brief clock module of clock unit common header file. + */ +#ifndef VEHICLESERVICE_CLOCKCLOCK_H_ // NOLINT(build/header_guard) unit common special +#define VEHICLESERVICE_CLOCKCLOCK_H_ // NOLINT(build/header_guard) unit common special + +#include <stub/Clock_API.h> + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup clock + * @ingroup vehicle_service + * @{ + */ + +/** @}*/ // end of clock +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem + +#endif // VEHICLESERVICE_CLOCKCLOCK_H_ diff --git a/stub/clock/client_clock/libClock_API.ver b/stub/clock/client_clock/libClock_API.ver new file mode 100644 index 00000000..b26c9cf2 --- /dev/null +++ b/stub/clock/client_clock/libClock_API.ver @@ -0,0 +1,29 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +######################### +# libClock_API version script # +######################### +{ + global: + ### .text section ### + Clock_*; + ### .data section ### + *clock_msg_handle; + local: + *; +}; + diff --git a/stub/clock/client_clock/src/Clock_API.cpp b/stub/clock/client_clock/src/Clock_API.cpp new file mode 100644 index 00000000..360c7bf0 --- /dev/null +++ b/stub/clock/client_clock/src/Clock_API.cpp @@ -0,0 +1,118 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Information. + * This source code is a sample source code . + * Implementation of the function must be performed by the vendor. + */ + +#include <stub/Clock_API.h> + +/* static variable definition */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + function prototype +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +CLOCK_RETURN Clock_getSystemTime(struct timespec* time, uint8_t* status) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_getLocalTime(const time_t* base_time, struct tm* local_time) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_CnvSecToDate(const time_t* timep, struct tm *result) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_CnvDateToSec(const struct tm* tm, time_t* result) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_setUserTime(const time_t* user_time) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_getUserTime(time_t* user_time, uint8_t* status) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_addUserTimeOffset(const struct tm* offset) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_getSystemTimeY2K38(uint32_t* time, uint8_t* status) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_getLocalTimeY2K38(const uint32_t* base_time, struct tm* local_time) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_CnvSecToDateY2K38(const uint32_t* time, struct tm *result) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} + +CLOCK_RETURN Clock_CnvDateToSecY2K38(const struct tm* tm, uint32_t* result) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return CLOCK_OK; +} diff --git a/stub/clock/client_display_time/Makefile b/stub/clock/client_display_time/Makefile new file mode 100644 index 00000000..48b2261d --- /dev/null +++ b/stub/clock/client_display_time/Makefile @@ -0,0 +1,47 @@ +# +# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +######### installed shared library(*.so) ############# +INST_SHLIBS = libDTime_Api + +######### install headers(*.h) ############# +INST_HEADERS = DTime_Api.h clock_notifications.h clock_display_time.h + +######### compiled sources ############# +libDTime_Api_SRCS = DTime_Api.cpp + +######### add source path ############# +VPATH += ./src ./include/stub + +######### add include path ############# +CPPFLAGS += -I./include + +######### add compile option ############# +LDFLAGS += -Wl,--no-undefined +LDFLAGS += -Wl,--gc-sections +LDFLAGS += -Wl,--no-as-needed + +CPPFLAGS += -Werror=implicit-function-declaration +CPPFLAGS += -Werror=format-security + +CPPFLAGS += -Wconversion +CPPFLAGS += -Wint-to-pointer-cast +CPPFLAGS += -Wpointer-arith +CPPFLAGS += -Wformat + +######### linked library (dynamic) ############# + +include ../../stub.mk diff --git a/stub/clock/client_display_time/include/stub/DTime_Api.h b/stub/clock/client_display_time/include/stub/DTime_Api.h new file mode 100644 index 00000000..7a07d199 --- /dev/null +++ b/stub/clock/client_display_time/include/stub/DTime_Api.h @@ -0,0 +1,916 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file DTime_Api.h + * @brief display time middle API header file. + */ +#ifndef CLOCK_CLIENT_DISPLAY_TIME_INCLUDE_VEHICLE_SERVICE_DTIME_API_H_ +#define CLOCK_CLIENT_DISPLAY_TIME_INCLUDE_VEHICLE_SERVICE_DTIME_API_H_ + +/**************************************************************************** + * File name : DTime_Api.h + * System name : + * Sub system name : Display time middle API header + * Title : Data Header Files Required for Using Display Time Middle + ****************************************************************************/ +#include <native_service/frameworkunified_types.h> +#include <stub/clock_notifications.h> + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup clock + * @ingroup vehicle_service + * @{ + */ + +/** + * \~english commod ID (from display time middle) + */ +typedef enum _ClockServiceProtocol { + CID_DTIME_NOTIFY = 0x00000712, //!< \~english Display time notice +} ClockServiceProtocol; + +/****************************************************************************** +* Structure : T_TimeData +* Function : Time structure +* Note : Stores the system/user time obtained from the Clock + *******************************************************************************/ +/** + * \~english Time structure T_TimeData, store system time/user time acquired from clock. + */ +typedef struct _tag_T_TimeData { + uint16_t Year; //!< \~english Year + uint8_t Month; //!< \~english Month + uint8_t Day; //!< \~english Day + uint8_t Hour; //!< \~english Hour + uint8_t Minute; //!< \~english Minute + uint8_t Second; //!< \~english Second + uint8_t rsv; //!< \~english Reserve +} T_TimeData; + +/** + * \~english +(plus) + */ +#define DTIME_TIMEDIFF_SIGN_PLUSE FALSE +/** + * \~english -(minus) + */ +#define DTIME_TIMEDIFF_SIGN_MINUS TRUE + +/** + * \~english Time zone structure. + */ +typedef struct _tag_T_TimeDiff { + BOOL Sign; //!< \~english Sign + uint8_t Hour_Diff; //!< \~english Time difference (hour) + uint8_t Minute_Diff; //!< \~english Time difference (minutes) + uint8_t rsv[2]; //!< \~english Reserve +} T_TimeDiff; + +/** + * \~english Time offset setting structure. + */ +typedef struct _tag_T_TimeOffset { + int8_t Hour_Offset; //!< \~english Time difference (hour) + int8_t Minute_Offset; //!< \~english Time difference (minutes) + int8_t rsv[2]; //!< \~english Reserve +} T_TimeOffset; + +/** + * \~english GPS automatic adjustment OFF (use system time). + */ +#define DTIME_SETTING_GPS_MANUAL FALSE + +/** + * \~english GPS automatic adjustment Auto (use display time when GPS correction OFF). + */ +#define DTIME_SETTING_GPS_AUTO TRUE + +/** + * \~english Notation in 12H. + */ +#define DTIME_SETTING_FORMAT_12H FALSE + +/** + * \~english Notation in 24H. + */ +#define DTIME_SETTING_FORMAT_24H TRUE + +/** + * \~english DST manual setting. + */ +#define DTIME_SETTING_DST_MANUAL FALSE + +/** + * \~english DST automatic setting. + */ +#define DTIME_SETTING_DST_AUTO TRUE + +/** + * \~english DST OFF + */ +#define DTIME_SETTING_DST_OFF FALSE + +/** + * \~english DST ON + */ +#define DTIME_SETTING_DST_ON TRUE + +/** + * \~english Time zone manual setting. + */ +#define DTIME_SETTING_TIMEZONE_MANUAL FALSE + +/** + * \~english Time zone automatic setting. + */ +#define DTIME_SETTING_TIMEZONE_AUTO TRUE + +/** + * \~english Display setting structure. + */ +typedef struct _tag_T_DisplaySetting { + BOOL GPS_Auto; //!< \~english GPS automatic setting + BOOL Format; //!< \~english 12H/24H display setting + BOOL DST_Auto; //!< \~english DST automatic settting + BOOL DST_Setting; //!< \~english DST_ON/OFF setting + BOOL TimeZone_Auto; //!< \~english Time zone automatic setting + T_TimeDiff TimeZone_Setting; //!< \~english Time zone time difference setting + T_TimeOffset TimeOffset; //!< \~english Time offset +} T_DisplaySetting; + +/** + * \~english Display time invalid. + */ +#define DTIME_DISP_TIME_INVALID FALSE + +/** + * \~english Display time valid. + */ +#define DTIME_DISP_TIME_VALID TRUE + +/** + * \~english Invalid AM/PM. + */ +#define DTIME_DISP_MERIDIEM_INVALID 0 + +/** + * \~english AM + */ +#define DTIME_DISP_MERIDIEM_AM 1 + +/** + * \~english PM + */ +#define DTIME_DISP_MERIDIEM_PM 2 + +/** + * \~english AM/PM unidentified in 12H display. + */ +#define DTIME_DISP_MERIDIEM_12H_INVALID 3 + +/** + * \~english Display time structure. + */ +typedef struct _tag_T_DTimeData { + BOOL TimeValidity; //!< \~english Validity of time display + uint8_t Meridiem; //!< \~english AM/PM + uint16_t DYear; //!< \~english Display date(year) + uint8_t DMonth; //!< \~english Display date(month) + uint8_t DDay; //!< \~english Display date(day) + uint8_t DHour; //!< \~english Display time(hour) + uint8_t DMinute; //!< \~english Display time(minute) + uint8_t rsv; //!< \~english Reserve +} T_DTimeData; + +/****************************************************************************** +* Structure : T_DTIME_MSG_NOTIFY_DTIME +* Function : Display time notification transmission data structure +* Note : + ******************************************************************************/ +/** + * \~english Display time notification transmission data structure T_DTIME_MSG_NOTIFY_DTIME. + */ +typedef struct _tag_T_DTIME_MSG_NOTIFY_DTIME { + T_DTimeData disp_time; //!< \~english Display time + T_DisplaySetting disp_setting; //!< \~english Display setting + T_TimeData org_time; //!< \~english Time(origin data) +} T_DTIME_MSG_NOTIFY_DTIME; + +/****************************************************************************** +* Structure : T_DTIME_MSG_GPSTIME +* Function : GPS time setting data structure +* Note : + ******************************************************************************/ +/** + * \~english GPS UTC time setting structure. + */ +typedef struct _tag_T_DTIME_GPSTIME { + uint16_t year; //!< \~english Year + uint8_t month; //!< \~english Month + uint8_t date; //!< \~english Day + uint8_t hour; //!< \~english Hour + uint8_t minute; //!< \~english Minute + uint8_t second; //!< \~english Second + uint8_t reserved; //!< \~english Reserve +} T_DTIME_GPSTIME; + +/** + * \~english Time uncalibrated after receiver reset. + */ +#define DTIME_GPS_STATUS_INVALID 0x00 + +/** + * \~english Time output by RTC backup (with time calibration results). + */ +#define DTIME_GPS_STATUS_RTC 0x01 + +/** + * \~english Time calibration completed. + */ +#define DTIME_GPS_STATUS_CORRECT 0x02 + +/** + * \~english GPS time setting data structure. + */ +typedef struct _tag_T_DTIME_MSG_GPSTIME { + T_DTIME_GPSTIME utc; //!< \~english GPS UTC time + uint8_t tdsts; //!< \~english Date and time status + uint8_t reserve[3]; //!< \~english Reserve +} T_DTIME_MSG_GPSTIME; + +/** Other definitions *********************************/ +/** + * \~english AM + */ +#define DTIME_SET_MERIDIEM_AM TRUE + +/** + * \~english PM + */ +#define DTIME_SET_MERIDIEM_PM FALSE + +/* Displayed Time Middle API Prototypes *************/ +/** + * \ingroup DTime_loadDisplaySetting + * \~english @par Brief + * - Load display settings. + * \~english @param [in] hApp Application handle + * \~english @param [in] Setting Display setting + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Display time is available after this API is called by SettingService.\n + * (It is assumed to call it only once at startup) + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When storage area of the display setting is NULL [eFrameworkunifiedStatusFail] + * - When the time difference(hour)specified by the argument Setting->TimeZone_Setting.Hour_Diff\n + * is greater than the time difference(hour)upper limit(13)[eFrameworkunifiedStatusFail] + * - Incorrect time difference(minutes)specified by argument Setting->TimeZone_Setting.Minute_Diff\n + * (when the value is not 0, 15, 30, 45). [eFrameworkunifiedStatusFail] + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage synchronization communication fails. [eFrameworkunifiedStatusFail] + * - When processing of loading display setting fails in clock service. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - Since this API is synchronous processing(completion recovery),\n + * it should be used in consideration of this. + * - When display time is used before this API is called by SettingService,\n + * even if DTime_registListener_DisplayTime() is used, display time notification can not be received. + * - (Since clock service does not publish display time notification.) + * - With this API, the following is information necessary for calculation of\n + * display time can be collectively set to Clock service. + * - GPS automatic setting, 12H/24H display setting, DST setting, time zone setting, time offset. + * - Set the time offset to 0 when GPS correction is OFF. + * - If the display time distribution has already been regitered,\n + * the Clock service will publish the display time notification immediately when this API is called. + * \~english @see DTime_getDisplaySetting, DTime_regist_Listener_DisplayTime, FrameworkunifiedMcOpenSender, FrameworkunifiedInvokeSync + */ +EFrameworkunifiedStatus DTime_loadDisplaySetting(HANDLE h_app, T_DisplaySetting *setting); /* Load display setting */ + +/** + * \ingroup DTime_getDisplaySetting + * \~english @par Brief + * - Load display settings. + * \~english @param [in] hApp Application handle + * \~english @param [in] Setting Display setting + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - This API should be called after DTime_loadDisplaySetting() is called. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When storage area of the display setting is NULL [eFrameworkunifiedStatusFail] + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage synchronization communication fails. [eFrameworkunifiedStatusFail] + * - When message length received by synchronous communication\n + * and length of storage buffer are different. [eFrameworkunifiedStatusFail] + * - When display setting on Clock service side is not loaded. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Sync + * \~english @par Detail + * - Since this API is synchronous processing(completion recovery),\n + * it should be used in consideration of this. + * - This API assumes that the Diag service will use it to acquire time difference information etc. + * - With this API, you can acquire the information on the right set at display time.\n + * GPS automatic setiting, 12H/24H display setting, DST setting, time zone setting, time offse. + * \~english @see DTime_loadDisplaySetting, FrameworkunifiedMcOpenSender, FrameworkunifiedInvokeSync + */ +EFrameworkunifiedStatus DTime_getDisplaySetting(HANDLE h_app, T_DisplaySetting *setting); /* Get display setting */ + +/** + * \ingroup DTime_setGpsTime + * \~english @par Brief + * - Set the GPS time on the clock. + * \~english @param [in] hApp Application handle + * \~english @param [in] gps_time GPS data setting + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the setting of storage area set by the GPS data/time setting is NULL. [eFrameworkunifiedStatusFail] + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called when the positioning service acquires/updates the GPS time. + * - Note : Do not use POS_RegisterListenerGPStime() from Clock service. + * - The GPS time notification command to the external clock is transmitted\n + * when this API is called. + * - With this API, GPS time can be set to clock function. + * GPS date and time (year, month, day, hour, minute, second)\n + * GPS date and time status\n + * 0 = Time not correct after receiver reset(time input or manager reset or CSF startup),\n + * 1 = RTC backup according to time output(actual result of time correction),\n + * 2 = Time correct done. + * \~english @see FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_setGpsTime(HANDLE h_app, T_DTIME_MSG_GPSTIME *gps_time); /* GPS time setting */ + +/** + * \ingroup DTime_registerListener_DTime + * \~english @par Brief + * - Register delivery of display time notification. + * \~english @param [in] hApp Application handle + * \~english @param [in] notifyName Delivery destination thread name. Note : Set it to 15 characters or less. + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the storage area specified by the destination thread name is NULL. [eFrameworkunifiedStatusFail] + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - The maximum number of registered listeners is 20. + * - If listeners are registered more than once from the same thread, count as one listener.\n + * however, in this case, the display time notification is immediately issued. + * - With this API, delivery of this display time notification to the thread\n + * designated as the argument is started. + * - When this API call is called, if the display setting is not loaded,\n + * you can not calculate the display time, so do not deliver the display time notification. + * - When this API is called, if the display setting has already been loaded,\n + * the Clock service immediately issues a display time notification. + * - A message is notified with a command "CID_DTIME_NOTIFY" when display time is deliveried. + * - The client receives the data of the T_DTIME_MSG_NOTIFY_DTIME structure in the above delivery message. + * - Message communication uses interprocess communication by NSFW. + * - Specify ClockMng thread (TN_CLOCK_MNG) as the sender when registering callback for receiving display time. + * - Display time is not delivered until SettingService calls DTime_loadDisplaySetting. + * \~english @see DTime_UnregisterListener_DTime, FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_registerListener_DTime(HANDLE h_app, PCSTR notify_name); /* Display time delivery registration */ + +/** + * \ingroup DTime_UnregisterListener_DTime + * \~english @par Brief + * - Release delivery of display time notification. + * \~english @param [in] hApp Application handle + * \~english @param [in] notifyName Delivery destination thread name. Note : Set it to 15 characters or less. + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the storage area specified by the destination thread name is NULL. [eFrameworkunifiedStatusFail] + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - With this API, releasing delivery registration of display time notification\n + * to the thread specified as argument is canceled. + * - Especially when the nonresident service is registering for delivery,\n + * be sure to cancel registration with this API in termination processing. + * \~english @see DTime_registerListener_DTime, FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_UnregisterListener_DTime(HANDLE h_app, PCSTR notify_name); /* Release display time delivery registration */ + +/** + * \ingroup DTime_setAutoAdjust + * \~english @par Brief + * - Set GPS automatic adjustment. + * \~english @param [in] hApp Application handle + * \~english @param [in] Setting Display setting.\n + * DTIME_SETTING_GPS_AUTO: GPS automatic adjust AUTO(use display time when GPS correction OFF)\n + * DTIME_SETTING_GPS_MANUAL: GPS automatic adjust OFF(use of system time) + * \~english @param [in] Offset Time offset.\n + * GPS correction is ON: User set hour offset, minute offset.\n + * GPS correction is OFF: set zero + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the storage area of the time offset is NULL. [eFrameworkunifiedStatusFail] + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, it is possible to switch the absolute time\n + * (GPS time or display time in the case of GPS correction off) which is the source of display time. + * - When GPS correction is OFF, count from the default time (2017/1/1 1:00). + * - When GPS correction OFF, set the time offset to zero and set the time\n + * offset with this API when GPS correction is ON. + * - When this API is called, if the display time distribution has already been refistered,\n + * the Clock service immediately issues a display time notification. + * - However, when an external clock is connected, the display time is not issued immediately\n + * and the display time is delivered at the timing of receiving the "Time notification". + * - When an external clock is connected, since the data master at the offset time\n + * becomes an external clock, the following processing is performed. + * - If the received time offset is + * - 1) When it is more than 1 hour ahead of the offset of the external clock \n + * -> Set to add 1 hour offsets to external clock. + * - 2) If it is less than 1 hour, 1 minute or more after the offset of the external clock \n + * -> Set to add 1 minute offsets to external clock. + * - 3) When it is more than -1 hour earlier of the offset of the external clock \n + * -> Set the external clock to subtract 1 hour offsets. + * - 4) When it is less than 1 hour or more than -1 minute from the offset of the external clock \n + * -> Set the external clock to subtract 1 minute offsets. + * - 5) When both hours and minutes are zero\n + * -> Set the external clock to clear zero. + * - Do not reflect changes in offset when GPS correction OFF<-->ON is switched. + * \~english @see FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_setAutoAdjust(HANDLE h_app, BOOL setting, T_TimeOffset *off_set); /* GPS automatic adjustment */ + +/** + * \ingroup DTime_increaseHour + * \~english @par Brief + * - Adjust the time. + * \~english @param [in] hApp Application handle + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, display time can be increased by one hour. Set the display\n + * time in the case of GPS correction off used when GPS correction OFF is set. + * - Note : The time offset when GPS correction ON is set by DTime_setAutoAdjust. + * - When this API is called, if the display time distribution has already been registered,\n + * the Clock service immediately issues a display time notification. + * - Note : However, when there is an external clock, and after receiving the time notification command,\n + * the display time notification is not issued immediately, and the display time is delivered at\n + * the timing of receiving the "time notification". + * - When an external clock is connected, set the absolute time hour (+) instruction to\n + * the external clock with the "setting SW information notification" command. + * \~english @see DTime_decreaseHour, DTime_setAutoAdjust, FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_increaseHour(HANDLE h_app); /* Adjust the time (hour increaase) */ + +/** + * \ingroup DTime_decreaseHour + * \~english @par Brief + * - Adjust time (decrease hour by 1 hour). + * \~english @param [in] hApp Application handle + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, display time can be reduced by 1 hour. Set the display time\n + * in the case of GPS correction off used when GPS correction OFF is set. + * - Note : The time offset when GPS correction ON is set by DTime_setAutoAdjust. + * - When this API is called, if the display time distribution has already been registered,\n + * the Clock service immediately issues a display time notification. + * - Note : However, when there is an external clock, and after receiving the time notification command,\n + * the display time notification is not issued immediately, and the display time is delivered\n + * at the timing of receiving the "time notification". + * - When an external clock is connected, set the absolute time hour (-) instruction\n + * with the "setting SW information notification" command to the external clock. + * \~english @see DTime_increaseHour, DTime_setAutoAdjust, FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_decreaseHour(HANDLE h_app); /* Adjust the time (hour decrease) */ + +/** + * \ingroup DTime_increaseMinute + * \~english @par Brief + * - Adjust the time (increase time by 1 minute). + * \~english @param [in] hApp Application handle + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, display time can be increased by one minute. Set the display time\n + * in the case of GPS correction off used when GPS correction OFF is set. + * - Note : The time offset when GPS correction ON is set by DTime_setAutoAdjust. + * - When this API is called, if the display time distribution has already been registered,\n + * the Clock service immediately issues a display time notification. + * - Note : However, when there is an external clock, and after receiving the time notification command,\n + * the display time notification is not issued immediately, and the display time is delivered\n + * at the timing of receiving the "time notification". + * - When an external clock is connected, set the absolute time minute (+) instruction\n + * to the external clock with the "setting SW information notification" command. + * \~english @see DTime_decreaseMinute, DTime_setAutoAdjust, FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_increaseMinute(HANDLE h_app); /* Adjust the time (minute increaase) */ + +/** + * \ingroup DTime_decreaseMinute + * \~english @par Brief + * - Adjust the time (decrease time by 1 minute). + * \~english @param [in] hApp Application handle + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, display time can be reduced by 1 minute. Set the display time\n + * in the case of GPS correction off used when GPS correction OFF is set. + * - Note : The time offset when GPS correction ON is set by DTime_setAutoAdjust. + * - When this API is called, if the display time distribution has already been registered,\n + * the Clock service immediately issues a display time notification. + * - Note : However, when there is an external clock, and after receiving the time notification command,\n + * the display time notification is not issued immediately, and the display time is delivered\n + * at the timing of receiving the "time notification". + * - When an external clock is connected, set the absolute time minute (-) instruction\n + * with the "setting SW information notification" command to the external clock. + * \~english @see DTime_increaseMinute, DTime_setAutoAdjust, FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_decreaseMinute(HANDLE h_app); /* Adjust the time (minute decrease) */ + +/** + * \ingroup DTime_clearMinute + * \~english @par Brief + * - Adjust the time (set the time to 0 minute). + * \~english @param [in] hApp Application handle + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, the display time can be set to 0 minutes. + * - When the display time is 30 to 59 minutes, increase the display time by one hour\n + * and then set the display time to 0 minutes. + * - If the display time is 0 to 29 minutes, set the dispaly time to 0 minutes only. + * - Set the internal offset to be used when GPS correction OFF. + * - Note : The time offset when GPS correction ON is set by DTime_setAutoAdjust. + * - When this API is called, if the display time distribution has already been registered,\n + * the Clock service immediately issues a display time notification. + * - Note : However, when there is an external clock, and after receiving the time notification command,\n + * the display time notification is not issued immediately, and the display time is delivered\n + * at the timing of receiving the "time notification". + * - When an external clock is connected, set the absolute time minute (-) instruction\n + * with the "setting SW information notification" command to the external clock. + * \~english @see DTime_setAutoAdjust, FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_clearMinute(HANDLE h_app); /* Adjust the time (minute clear) */ + +/** + * \ingroup DTime_setAMPM + * \~english @par Brief + * - Set AM/PM. + * \~english @param [in] hApp Application handle + * \~english @param [in] Meridiem AM/PM setting\n + * AM : DTIME_SET_MERIDIEM_AM(TRUE)\n + * PM : DTIME_SET_MERIDIEM_PM(FALSE) + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When message asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, AM/PM of display time can be switched. + * - When PM is selected with the display time (Hour of T_DTimeData) set to\n + * AM (0 to 11 o'clock), the display time is +12h. + * - When AM is selected at the display time (Hour of T_DTimeData) at PM (12 to 23 o'clock),\n + * it makes -12h at display time. + * - Set the internal offset to be used when GPS correction OFF. + * - Note : The time offset when GPS correction ON is set by DTime_setAutoAdjust. + * - When this API is called, if the display time distribution has already been registered,\n + * the Clock service immediately issues a display time notification. + * - Note : However, when there is an external clock, and after receiving the time notification command,\n + * the display time notification is not issued immediately, and the display time is delivered\n + * at the timing of receiving the "time notification". + * \~english @see DTime_setAutoAdjust, FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_setAMPM(HANDLE h_app, BOOL meridiem); /* AM/PM setting */ + +/** + * \ingroup DTime_setFormat + * \~english @par Brief + * - 12h/24h sets the display format. + * \~english @param [in] hApp Application handle + * \~english @param [in] Setting Display setting\n + * DTIME_SETTING_FORMAT_12H(FALSE): Notation in 12H\n + * DTIME_SETTING_FORMAT_24H(TRUE): Notation in 24H + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, it is possible to switch the display time 12H notation/24H notation. + * - When this API is called, if the display time distribution has already been registered,\n + * the Clock service immediately issues a display time notification. + * \~english @see FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_setFormat(HANDLE h_app, BOOL setting); /* format setting */ + +/** + * \ingroup DTime_setTimeZone + * \~english @par Brief + * - Set the time zone. + * \~english @param [in] hApp Application handle + * \~english @param [in] Auto Time zone automatic setting\n + * DTIME_SETTING_TIMEZONE_AUTO (TRUE): Time zone automatic setting\n + * DTIME_SETTING_TIMEZONE_MANUAL (FALSE): Time zone manual setting + * \~english @param [in] Diff Time zone time difference setting + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the time zone time time difference setting storage area is NULL. [eFrameworkunifiedStatusFail] + * - When the time difference(hour)specified by the argument Diff->Hour_Diff\n + * is greater than the time difference(hour)upper limit value(13)[eFrameworkunifiedStatusFail] + * - When the time difference(minutes)specified by the argument Diff->Minute_Diff\n + * is incorrect (When the time difference (minutes) specified by the argument\n + * Diff->Minute_Diff is not 0, 15, 30, 45). [eFrameworkunifiedStatusFail] + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, you can set time zone automatic switching and time zone setting. + * - When this API is called, if the display time distribution has already been registered,\n + * the Clock service immediately issues a display time notification. + * - Note : However, when there is an external clock, and after receiving the time notification command,\n + * the display time notification is not issued immediately, and the display time is delivered\n + * at the timing of receiving the "time notification". + * - Depending on the time zone automatic setting of the second argument, set the third argument as follows. + * - MANUAL: User's setting value. + * - MANUAL/AUTO Time zones update each time the time zone setting changes. + * - Note : When MANUAL, it is not necessary to call this API each time "TZ status notification" is received. + * \~english @see FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_setTimeZone(HANDLE h_app, BOOL b_auto, T_TimeDiff *diff); /* time zone setting */ + +/** + * \ingroup DTime_setDST + * \~english @par Brief + * - Set DST. + * \~english @param [in] hApp Application handle + * \~english @param [in] Auto Time zone automatic setting\n + * DTIME_SETTING_DST_AUTO (TRUE): DST automatic setting\n + * DTIME_SETTING_DST_MANUAL (FALSE): DST manual setting + * \~english @param [in] Setting Time zone time difference setting + * DTIME_SETTING_DST_ON (TRUE)\n + * DTIME_SETTING_DST_OFF (FALSE) + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, you can compete for automatic switching of DST, and can set ON/OFF. + * - When this API is called, the Clock service immediately issues a display time notification. + * - Note : However, when there is an external clock, and after receiving the time notification command,\n + * the display time notification is not issued immediately, and the display time is delivered\n + * at the timing of receiving the "time notification". + * - Depending on the DST automatic setting of the second argument, set the third argument as follows. + * - MANUAL: User's setting value. + * - MANUAL/AUTO update each DST ON/OFF setting if there is a change. + * - Note : When MANUAL, it is not necessary to call this API each time "DST status notification" is received. + * \~english @see FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_setDST(HANDLE h_app, BOOL b_auto, BOOL setting); /* DST setting */ + +/** + * \ingroup DTime_notifySwOff + * \~english @par Brief + * - Notify SW OFF information. + * \~english @param [in] h_app Application handle + * \~english @retval eFrameworkunifiedStatusOK success + * \~english @retval eFrameworkunifiedStatusFail fail(including parameter error) + * \~english @par Prerequisite + * - The availability of Clock service is TRUE. + * - Dispatcher for application is genereted/initialized(FrameworkunifiedCreateDispatcherWithoutLoop etc.). + * \~english @par Change of internal state + * - Change of internal state according to the API does not occur. + * \~english @par Conditions of processing failure + * - When the generation of the message queue handle for transmission with\n + * the Clock service has failed. [eFrameworkunifiedStatusFail] + * - When messsage asynchronous communication fails. [eFrameworkunifiedStatusFail] + * \~english @par Classification + * - Public + * \~english @par Type + * - Fire and Forget + * \~english @par Detail + * - This API is assumed to be called by SettingService. + * - With this API, you can notify SW OFF informations of image operations to Extern clock(Meter Device). + * - Note : Do nothing while Extern clock doesn't exist. + * - After calling this API,the SW OFF will not be notified immediately,it will be notified while Meter exists. + * - while error occurs(API return eFrameworkunifiedStatusFail),need to recall this API.\n + * \n + * - Switch ON notification should be executed among the corresponding API of operations as followed. + * <table> + * <tr><th>API name(Switch ON notification) </th><th>OFF notification neccessary/unneccessary </th><th>note(reason of unneccessary)</th></tr> + * <tr><td>DTime_loadDisplaySetting </td><td>unneccessary </td><td>apart from button operation</td></tr> + * <tr><td>DTime_getDisplaySetting </td><td>unneccessary </td><td>apart from button operation</td></tr> + * <tr><td>DTime_setGpsTime </td><td>unneccessary </td><td>apart from button operation</td></tr> + * <tr><td>DTime_registerListener_DTime </td><td>unneccessary </td><td>apart from button operation</td></tr> + * <tr><td>DTime_UnregisterListener_DTime </td><td>unneccessary </td><td>apart from button operation</td></tr> + * <tr><td>DTime_setAutoAdjust </td><td>neccessary </td><td></td></tr> + * <tr><td>DTime_increaseHour </td><td>neccessary </td><td></td></tr> + * <tr><td>DTime_decreaseHour </td><td>neccessary </td><td></td></tr> + * <tr><td>DTime_increaseMinute </td><td>neccessary </td><td></td></tr> + * <tr><td>DTime_decreaseMinute </td><td>neccessary </td><td></td></tr> + * <tr><td>DTime_clearMinute </td><td>neccessary </td><td></td></tr> + * <tr><td>DTime_setAMPM </td><td>unneccessary </td><td>extern clock is unneccessary</td></tr> + * <tr><td>DTime_setFormat </td><td>neccessary </td><td></td></tr> + * <tr><td>DTime_setTimeZone </td><td>unneccessary </td><td>there is no extern clock SW ON/OFF notification</td></tr> + * <tr><td>DTime_setDST </td><td>unneccessary </td><td>there is no extern clock SW ON/OFF notification</td></tr> + * </table> + * \n + * \~english @see FrameworkunifiedMcOpenSender, FrameworkunifiedSendMsg + */ +EFrameworkunifiedStatus DTime_notifySwOff(HANDLE h_app); /* SW OFF notification */ + +/** @}*/ // end of clock +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem + +#endif // CLOCK_CLIENT_DISPLAY_TIME_INCLUDE_VEHICLE_SERVICE_DTIME_API_H_ diff --git a/stub/clock/client_display_time/include/stub/clock_display_time.h b/stub/clock/client_display_time/include/stub/clock_display_time.h new file mode 100644 index 00000000..1cf19dbc --- /dev/null +++ b/stub/clock/client_display_time/include/stub/clock_display_time.h @@ -0,0 +1,42 @@ +/* + * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file clock_display_time.h + * @brief display time module of clock unit common header file. + */ +#ifndef VEHICLESERVICE_CLOCKDISPLAYTIME_H_ // NOLINT(build/header_guard) unit common special +#define VEHICLESERVICE_CLOCKDISPLAYTIME_H_ // NOLINT(build/header_guard) unit common special + +#include <stub/DTime_Api.h> +#include <stub/clock_notifications.h> + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup clock + * @ingroup vehicle_service + * @{ + */ + +/** @}*/ // end of clock +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem + +#endif // VEHICLESERVICE_CLOCKDISPLAYTIME_H_ diff --git a/stub/clock/client_display_time/include/stub/clock_notifications.h b/stub/clock/client_display_time/include/stub/clock_notifications.h new file mode 100644 index 00000000..29eb836c --- /dev/null +++ b/stub/clock/client_display_time/include/stub/clock_notifications.h @@ -0,0 +1,46 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file clock_notifications.h + * @brief Notification names defined in the file. + */ +#ifndef CLOCK_CLIENT_DISPLAY_TIME_INCLUDE_VEHICLE_SERVICE_CLOCK_NOTIFICATIONS_H_ +#define CLOCK_CLIENT_DISPLAY_TIME_INCLUDE_VEHICLE_SERVICE_CLOCK_NOTIFICATIONS_H_ + +#include <agl_thread.h> + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup vehicle_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup clock + * @ingroup vehicle_service + * @{ + */ + +/** + * \~english clock service availability notify. + */ +#define NTFY_Clock_Availability MN_CLOCK"/Availability" + +/** @}*/ // end of clock +/** @}*/ // end of vehicle_service +/** @}*/ // end of BaseSystem + +#endif // CLOCK_CLIENT_DISPLAY_TIME_INCLUDE_VEHICLE_SERVICE_CLOCK_NOTIFICATIONS_H_ diff --git a/stub/clock/client_display_time/libDTime_Api.ver b/stub/clock/client_display_time/libDTime_Api.ver new file mode 100644 index 00000000..47e22d46 --- /dev/null +++ b/stub/clock/client_display_time/libDTime_Api.ver @@ -0,0 +1,31 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +######################### +# libDTime_Api version script # +######################### +{ + global: + ### .text section ### + extern "C++" { + DTime_*; + }; + ### .data section ### + *s_clock_hApp; + local: + *; +}; + diff --git a/stub/clock/client_display_time/src/DTime_Api.cpp b/stub/clock/client_display_time/src/DTime_Api.cpp new file mode 100644 index 00000000..cf1f96b2 --- /dev/null +++ b/stub/clock/client_display_time/src/DTime_Api.cpp @@ -0,0 +1,246 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Information. + * This source code is a sample source code . + * Implementation of the function must be performed by the vendor. + */ + +#include <stub/DTime_Api.h> +#include <native_service/frameworkunified_framework_if.h> + +#define DTIME_PARAM_NG FALSE +#define DTIME_PARAM_OK TRUE + +/****************************************************************************** + * API name : DTime_loadDisplaySetting + * Function : Load display setting + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_loadDisplaySetting(HANDLE h_app, T_DisplaySetting *setting ) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_getDisplaySetting + * Function : Get display setting + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_getDisplaySetting(HANDLE h_app, T_DisplaySetting *setting ) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_setGpsTime + * Function : GPS time setting + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_setGpsTime(HANDLE h_app, T_DTIME_MSG_GPSTIME *gps_time ) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_registerListener_DTime + * Function : Display time delivery registration + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_registerListener_DTime(HANDLE h_app, PCSTR notify_name) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_UnregisterListener_DTime + * Function : Release time delivery registration + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_UnregisterListener_DTime(HANDLE h_app, PCSTR notify_name) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_setAutoAdjust + * Function : GPS auto adjust setting + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_setAutoAdjust(HANDLE h_app, BOOL setting, T_TimeOffset *offset) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_increaseHour + * Function : Adjust the time (hour increaase) + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_increaseHour(HANDLE h_app) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_decreaseHour + * Function : Adjust the time (hour decrease) + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_decreaseHour(HANDLE h_app) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_increaseMinute + * Function : Adjust the time (minute increaase) + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_increaseMinute(HANDLE h_app) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_decreaseMinute + * Function : Adjust the time (minute decrease) + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_decreaseMinute(HANDLE h_app) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_clearMinute + * Function : Adjust the time (minute clear) + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_clearMinute(HANDLE h_app) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_setAMPM + * Function : AM/PM setting + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_setAMPM(HANDLE h_app, BOOL meridiem) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_setFormat + * Function : Format setting + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_setFormat(HANDLE h_app, BOOL setting ) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_setTimeZone + * Function : Time zone setting + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_setTimeZone(HANDLE h_app, BOOL b_auto, T_TimeDiff *diff ) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/****************************************************************************** + * API name : DTime_setDST + * Function : DST setting + * Outline : + ******************************************************************************/ +EFrameworkunifiedStatus DTime_setDST(HANDLE h_app, BOOL b_auto, BOOL setting ) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + + +/****************************************************************************** + * API name : DTime_notifySwOff + * Function : SW OFF notification + * Outline : + * Note : Used to notify the SW OFF of on-screen operations. + ******************************************************************************/ +EFrameworkunifiedStatus DTime_notifySwOff(HANDLE h_app) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return eFrameworkunifiedStatusOK; +} + +/** Parameter check functions **/ +BOOL CheckParamTimeZone(T_TimeDiff *diff) { + /* + * Note. + * This feature needs to be implemented by the vendor. + */ + return DTIME_PARAM_OK; +} diff --git a/stub/clock/localtime/Makefile b/stub/clock/localtime/Makefile new file mode 100644 index 00000000..fc75dd8c --- /dev/null +++ b/stub/clock/localtime/Makefile @@ -0,0 +1,49 @@ +# +# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +## +## Makefile - Makefile for TimeZone file +## + +ZONEINFDIR = $(DESTDIR)/usr/share/zoneinfo/ +ZONEINFLNK = /etc/ +ZONEINFDIR2 = $(DESTDIR)/etc/ +ZONEINFLNK2 = /tmp/bs/clock/ +ZONEINFFILE= localtime +DSTDIR = $(ZONEINFDIR)DST +CLEAN_DIRS = $(ZONEINFDIR) + +LDFLAGS += -Wl,--no-undefined +CPPFLAGS += -Werror=implicit-function-declaration +CPPFLAGS += -Werror=format-security + +CPPFLAGS += -Wconversion +CPPFLAGS += -Wint-to-pointer-cast +CPPFLAGS += -Wpointer-arith +CPPFLAGS += -Wformat + +install-data: + rm -rf $(ZONEINFDIR) ;\ + mkdir -p $(DSTDIR) ;\ + mkdir -p $(ZONEINFDIR2) ; + +## /usr/sbin/zic -d $(ZONEINFDIR) zoneinfo_base; + zic -d $(ZONEINFDIR) zoneinfo_base; + + ln -f -s $(ZONEINFLNK)$(ZONEINFFILE) $(ZONEINFDIR)$(ZONEINFFILE); \ + ln -f -s $(ZONEINFLNK2)$(ZONEINFFILE) $(ZONEINFDIR2)$(ZONEINFFILE) + +include ../../stub.mk diff --git a/stub/clock/localtime/zoneinfo_base b/stub/clock/localtime/zoneinfo_base new file mode 100644 index 00000000..944eabd3 --- /dev/null +++ b/stub/clock/localtime/zoneinfo_base @@ -0,0 +1,232 @@ +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule DST min max - Jan 1 0:00u 1:00 - + +# DST OFF +# Zone NAME UTCOFF RULES FORMAT [UNTIL] +Zone UTC-1345 -13:45 - UTC-13 +Zone UTC-1330 -13:30 - UTC-13 +Zone UTC-1315 -13:15 - UTC-13 +Zone UTC-1300 -13 - UTC-13 +Zone UTC-1245 -12:45 - UTC-12 +Zone UTC-1230 -12:30 - UTC-12 +Zone UTC-1215 -12:15 - UTC-12 +Zone UTC-1200 -12 - UTC-12 +Zone UTC-1145 -11:45 - UTC-11 +Zone UTC-1130 -11:30 - UTC-11 +Zone UTC-1115 -11:15 - UTC-11 +Zone UTC-1100 -11 - UTC-11 +Zone UTC-1045 -10:45 - UTC-10 +Zone UTC-1030 -10:30 - UTC-10 +Zone UTC-1015 -10:15 - UTC-10 +Zone UTC-1000 -10 - UTC-10 +Zone UTC-0945 -9:45 - UTC-9 +Zone UTC-0930 -9:30 - UTC-9 +Zone UTC-0915 -9:15 - UTC-9 +Zone UTC-0900 -9 - UTC-9 +Zone UTC-0845 -8:45 - UTC-8 +Zone UTC-0830 -8:30 - UTC-8 +Zone UTC-0815 -8:15 - UTC-8 +Zone UTC-0800 -8 - UTC-8 +Zone UTC-0745 -7:45 - UTC-7 +Zone UTC-0730 -7:30 - UTC-7 +Zone UTC-0715 -7:15 - UTC-7 +Zone UTC-0700 -7 - UTC-7 +Zone UTC-0645 -6:45 - UTC-6 +Zone UTC-0630 -6:30 - UTC-6 +Zone UTC-0615 -6:15 - UTC-6 +Zone UTC-0600 -6 - UTC-6 +Zone UTC-0545 -5:45 - UTC-5 +Zone UTC-0530 -5:30 - UTC-5 +Zone UTC-0515 -5:15 - UTC-5 +Zone UTC-0500 -5 - UTC-5 +Zone UTC-0445 -4:45 - UTC-4 +Zone UTC-0430 -4:30 - UTC-4 +Zone UTC-0415 -4:15 - UTC-4 +Zone UTC-0400 -4 - UTC-4 +Zone UTC-0345 -3:45 - UTC-3 +Zone UTC-0330 -3:30 - UTC-3 +Zone UTC-0315 -3:15 - UTC-3 +Zone UTC-0300 -3 - UTC-3 +Zone UTC-0245 -2:45 - UTC-2 +Zone UTC-0230 -2:30 - UTC-2 +Zone UTC-0215 -2:15 - UTC-2 +Zone UTC-0200 -2 - UTC-2 +Zone UTC-0145 -1:45 - UTC-1 +Zone UTC-0130 -1:30 - UTC-1 +Zone UTC-0115 -1:15 - UTC-1 +Zone UTC-0100 -1 - UTC-1 +Zone UTC-0045 -0:45 - UTC-0 +Zone UTC-0030 -0:30 - UTC-0 +Zone UTC-0015 -0:15 - UTC-0 +Zone UTC+0000 0 - UTC+0 +Zone UTC+0015 0:15 - UTC+0 +Zone UTC+0030 0:30 - UTC+0 +Zone UTC+0045 0:45 - UTC+0 +Zone UTC+0100 1 - UTC+1 +Zone UTC+0115 1:15 - UTC+1 +Zone UTC+0130 1:30 - UTC+1 +Zone UTC+0145 1:45 - UTC+1 +Zone UTC+0200 2 - UTC+2 +Zone UTC+0215 2:15 - UTC+2 +Zone UTC+0230 2:30 - UTC+2 +Zone UTC+0245 2:45 - UTC+2 +Zone UTC+0300 3 - UTC+3 +Zone UTC+0315 3:15 - UTC+3 +Zone UTC+0330 3:30 - UTC+3 +Zone UTC+0345 3:45 - UTC+3 +Zone UTC+0400 4 - UTC+4 +Zone UTC+0415 4:15 - UTC+4 +Zone UTC+0430 4:30 - UTC+4 +Zone UTC+0445 4:45 - UTC+4 +Zone UTC+0500 5 - UTC+5 +Zone UTC+0515 5:15 - UTC+5 +Zone UTC+0530 5:30 - UTC+5 +Zone UTC+0545 5:45 - UTC+5 +Zone UTC+0600 6 - UTC+6 +Zone UTC+0615 6:15 - UTC+6 +Zone UTC+0630 6:30 - UTC+6 +Zone UTC+0645 6:45 - UTC+6 +Zone UTC+0700 7 - UTC+7 +Zone UTC+0715 7:15 - UTC+7 +Zone UTC+0730 7:30 - UTC+7 +Zone UTC+0745 7:45 - UTC+7 +Zone UTC+0800 8 - UTC+8 +Zone UTC+0815 8:15 - UTC+8 +Zone UTC+0830 8:30 - UTC+8 +Zone UTC+0845 8:45 - UTC+8 +Zone UTC+0900 9 - UTC+9 +Zone UTC+0915 9:15 - UTC+9 +Zone UTC+0930 9:30 - UTC+9 +Zone UTC+0945 9:45 - UTC+9 +Zone UTC+1000 10 - UTC+10 +Zone UTC+1015 10:15 - UTC+10 +Zone UTC+1030 10:30 - UTC+10 +Zone UTC+1045 10:45 - UTC+10 +Zone UTC+1100 11 - UTC+11 +Zone UTC+1115 11:15 - UTC+11 +Zone UTC+1130 11:30 - UTC+11 +Zone UTC+1145 11:45 - UTC+11 +Zone UTC+1200 12 - UTC+12 +Zone UTC+1215 12:15 - UTC+12 +Zone UTC+1230 12:30 - UTC+12 +Zone UTC+1245 12:45 - UTC+12 +Zone UTC+1300 13 - UTC+13 +Zone UTC+1315 13:15 - UTC+13 +Zone UTC+1330 13:30 - UTC+13 +Zone UTC+1345 13:45 - UTC+13 + +# DST ON +# Zone NAME UTCOFF RULES FORMAT [UNTIL] +Zone DST/UTC-1345 -13:45 DST UTC-13 +Zone DST/UTC-1330 -13:30 DST UTC-13 +Zone DST/UTC-1315 -13:15 DST UTC-13 +Zone DST/UTC-1300 -13 DST UTC-13 +Zone DST/UTC-1245 -12:45 DST UTC-12 +Zone DST/UTC-1230 -12:30 DST UTC-12 +Zone DST/UTC-1215 -12:15 DST UTC-12 +Zone DST/UTC-1200 -12 DST UTC-12 +Zone DST/UTC-1145 -11:45 DST UTC-11 +Zone DST/UTC-1130 -11:30 DST UTC-11 +Zone DST/UTC-1115 -11:15 DST UTC-11 +Zone DST/UTC-1100 -11 DST UTC-11 +Zone DST/UTC-1045 -10:45 DST UTC-10 +Zone DST/UTC-1030 -10:30 DST UTC-10 +Zone DST/UTC-1015 -10:15 DST UTC-10 +Zone DST/UTC-1000 -10 DST UTC-10 +Zone DST/UTC-0945 -9:45 DST UTC-9 +Zone DST/UTC-0930 -9:30 DST UTC-9 +Zone DST/UTC-0915 -9:15 DST UTC-9 +Zone DST/UTC-0900 -9 DST UTC-9 +Zone DST/UTC-0845 -8:45 DST UTC-8 +Zone DST/UTC-0830 -8:30 DST UTC-8 +Zone DST/UTC-0815 -8:15 DST UTC-8 +Zone DST/UTC-0800 -8 DST UTC-8 +Zone DST/UTC-0745 -7:45 DST UTC-7 +Zone DST/UTC-0730 -7:30 DST UTC-7 +Zone DST/UTC-0715 -7:15 DST UTC-7 +Zone DST/UTC-0700 -7 DST UTC-7 +Zone DST/UTC-0645 -6:45 DST UTC-6 +Zone DST/UTC-0630 -6:30 DST UTC-6 +Zone DST/UTC-0615 -6:15 DST UTC-6 +Zone DST/UTC-0600 -6 DST UTC-6 +Zone DST/UTC-0545 -5:45 DST UTC-5 +Zone DST/UTC-0530 -5:30 DST UTC-5 +Zone DST/UTC-0515 -5:15 DST UTC-5 +Zone DST/UTC-0500 -5 DST UTC-5 +Zone DST/UTC-0445 -4:45 DST UTC-4 +Zone DST/UTC-0430 -4:30 DST UTC-4 +Zone DST/UTC-0415 -4:15 DST UTC-4 +Zone DST/UTC-0400 -4 DST UTC-4 +Zone DST/UTC-0345 -3:45 DST UTC-3 +Zone DST/UTC-0330 -3:30 DST UTC-3 +Zone DST/UTC-0315 -3:15 DST UTC-3 +Zone DST/UTC-0300 -3 DST UTC-3 +Zone DST/UTC-0245 -2:45 DST UTC-2 +Zone DST/UTC-0230 -2:30 DST UTC-2 +Zone DST/UTC-0215 -2:15 DST UTC-2 +Zone DST/UTC-0200 -2 DST UTC-2 +Zone DST/UTC-0145 -1:45 DST UTC-1 +Zone DST/UTC-0130 -1:30 DST UTC-1 +Zone DST/UTC-0115 -1:15 DST UTC-1 +Zone DST/UTC-0100 -1 DST UTC-1 +Zone DST/UTC-0045 -0:45 DST UTC-0 +Zone DST/UTC-0030 -0:30 DST UTC-0 +Zone DST/UTC-0015 -0:15 DST UTC-0 +Zone DST/UTC+0000 0 DST UTC+0 +Zone DST/UTC+0015 0:15 DST UTC+0 +Zone DST/UTC+0030 0:30 DST UTC+0 +Zone DST/UTC+0045 0:45 DST UTC+0 +Zone DST/UTC+0100 1 DST UTC+1 +Zone DST/UTC+0115 1:15 DST UTC+1 +Zone DST/UTC+0130 1:30 DST UTC+1 +Zone DST/UTC+0145 1:45 DST UTC+1 +Zone DST/UTC+0200 2 DST UTC+2 +Zone DST/UTC+0215 2:15 DST UTC+2 +Zone DST/UTC+0230 2:30 DST UTC+2 +Zone DST/UTC+0245 2:45 DST UTC+2 +Zone DST/UTC+0300 3 DST UTC+3 +Zone DST/UTC+0315 3:15 DST UTC+3 +Zone DST/UTC+0330 3:30 DST UTC+3 +Zone DST/UTC+0345 3:45 DST UTC+3 +Zone DST/UTC+0400 4 DST UTC+4 +Zone DST/UTC+0415 4:15 DST UTC+4 +Zone DST/UTC+0430 4:30 DST UTC+4 +Zone DST/UTC+0445 4:45 DST UTC+4 +Zone DST/UTC+0500 5 DST UTC+5 +Zone DST/UTC+0515 5:15 DST UTC+5 +Zone DST/UTC+0530 5:30 DST UTC+5 +Zone DST/UTC+0545 5:45 DST UTC+5 +Zone DST/UTC+0600 6 DST UTC+6 +Zone DST/UTC+0615 6:15 DST UTC+6 +Zone DST/UTC+0630 6:30 DST UTC+6 +Zone DST/UTC+0645 6:45 DST UTC+6 +Zone DST/UTC+0700 7 DST UTC+7 +Zone DST/UTC+0715 7:15 DST UTC+7 +Zone DST/UTC+0730 7:30 DST UTC+7 +Zone DST/UTC+0745 7:45 DST UTC+7 +Zone DST/UTC+0800 8 DST UTC+8 +Zone DST/UTC+0815 8:15 DST UTC+8 +Zone DST/UTC+0830 8:30 DST UTC+8 +Zone DST/UTC+0845 8:45 DST UTC+8 +Zone DST/UTC+0900 9 DST UTC+9 +Zone DST/UTC+0915 9:15 DST UTC+9 +Zone DST/UTC+0930 9:30 DST UTC+9 +Zone DST/UTC+0945 9:45 DST UTC+9 +Zone DST/UTC+1000 10 DST UTC+10 +Zone DST/UTC+1015 10:15 DST UTC+10 +Zone DST/UTC+1030 10:30 DST UTC+10 +Zone DST/UTC+1045 10:45 DST UTC+10 +Zone DST/UTC+1100 11 DST UTC+11 +Zone DST/UTC+1115 11:15 DST UTC+11 +Zone DST/UTC+1130 11:30 DST UTC+11 +Zone DST/UTC+1145 11:45 DST UTC+11 +Zone DST/UTC+1200 12 DST UTC+12 +Zone DST/UTC+1215 12:15 DST UTC+12 +Zone DST/UTC+1230 12:30 DST UTC+12 +Zone DST/UTC+1245 12:45 DST UTC+12 +Zone DST/UTC+1300 13 DST UTC+13 +Zone DST/UTC+1315 13:15 DST UTC+13 +Zone DST/UTC+1330 13:30 DST UTC+13 +Zone DST/UTC+1345 13:45 DST UTC+13 + +Link UTC+0000 UTC |