common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / peripheralservice / communication / server / include / threads / Thread_Common.h
1 /*
2  * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 #ifndef COMMUNICATION_SERVER_INCLUDE_THREADS_THREAD_COMMON_H_
17 #define COMMUNICATION_SERVER_INCLUDE_THREADS_THREAD_COMMON_H_
18 #include <stdint.h>
19 #include <can_hal.h>
20 #include <string>
21 #include <sstream>
22 #include <iostream>
23
24 const int32_t CAN_AVAILABILITY = 0x1;
25
26 void CommonInit(void);
27 HANDLE CommonFindSender(HANDLE h_app, std::string s);
28 BOOL CommGetAvailabilityCurrent(int32_t current);
29 void CommSetAvailabilityCurrent(int32_t current);
30 void CommClrAvailabilityCurrent(int32_t current);
31 EFrameworkunifiedStatus CommonStartNotify(HANDLE h_app, PCSTR cmd);
32 EFrameworkunifiedStatus CommonThreadStart(HANDLE h_app, const FrameworkunifiedProtocolCallbackHandler *cb,
33                       UI_32 count, PCSTR cmd, EFrameworkunifiedStatus (*open_func)(HANDLE));
34 EFrameworkunifiedStatus CommonThreadStop(HANDLE h_app, const PUI_32 cb, UI_32 count,
35                                   PCSTR cmd, EFrameworkunifiedStatus (*close_func)(HANDLE));
36 EFrameworkunifiedStatus CommonCanHalErrorNotify(HANDLE h_app);
37
38 static inline EFrameworkunifiedStatus ConvRet(CANHAL_RET_API ret) {
39   return ((ret != CANHAL_RET_NORMAL) ? eFrameworkunifiedStatusFail : eFrameworkunifiedStatusOK);
40 }
41 std::string MessageDataOutputLog(uint8_t *msg_data, uint32_t len);
42 #endif