2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include <native_service/frameworkunified_framework_if.h>
22 #include "tskm_debug.h"
25 TSKM_ERR_t TSKM_SvcCtl(TSKM_SVCID_t svcId, const TSKM_SVC_CTL_t* ctl) {
29 for (ii = 0; ii < 3; ii++) {
31 tskmRet = _TSKM_SvcCtl(svcId, ctl);
32 if (tskmRet == TSKM_E_RETRY) {
33 usleep(300 * 1000); // 300ms wait
42 TSKM_ERR_t TSKM_ErrorReboot(const TSKM_ERROR_REBOOT_t* p_info) {
43 TSKM_ERR_t tskmRet = TSKM_E_OK;
46 rpcRet = _TSKM_ErrorReboot(p_info);
47 if (RPC_OK != rpcRet) {
54 TSKM_ERR_t TSKM_DataInit(HANDLE hApp, const TSKM_DATAINIT_t *p_info) {
55 TSKM_ERR_t tskmRet = TSKM_E_NG;
56 TSKM_PRINTF(TSKM_LOG_API, "%s()", __FUNCTION__)
58 if (!p_info || !hApp || (p_info->type != TSKM_DATAINIT_TYPE_USER)
59 || !(p_info->onCompInit)) {
64 // LCOV_EXCL_BR_START 10: Due to compiler dependency
65 EFrameworkunifiedStatus l_eStatus = FrameworkunifiedAttachCallbackToDispatcher(hApp,
70 if (eFrameworkunifiedStatusOK != l_eStatus) {
73 HANDLE hSvc = FrameworkunifiedOpenService(hApp, SS_TASK_MANAGER);
76 tskmRet = TSKM_E_STATE;
78 if (eFrameworkunifiedStatusOK != FrameworkunifiedSendMsg(hSvc, TSKM_DATAINIT_REQ, 0, NULL)) {
85 TSKM_ASSERT(eFrameworkunifiedStatusOK == FrameworkunifiedCloseService(hApp, hSvc));
89 } // LCOV_EXCL_BR_LINE 10: Final line