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.
17 // Communication module header file
18 #ifndef TASK_MANAGER_SERVER_INCLUDE_TSKM_COMM_H_
19 #define TASK_MANAGER_SERVER_INCLUDE_TSKM_COMM_H_
21 #include <sys/types.h>
22 #include "system_service/tskm_local_type.h"
24 #define TSKM_SOCKET_NAME "/tmp/tskm_sock" // Sockets for Primary Library
26 #define TSKM_COMM_CONNECT_MAX (32)
35 TSKM_SRV_CONNENT_t conn[TSKM_COMM_CONNECT_MAX];
36 } TSKM_SRV_CONNENT_LIST_t;
41 TSKM_SRV_CONNENT_LIST_t connList;
42 } TSKM_SRV_SOCK_CTX_t;
44 TSKM_ERR_t tskm_srvSockCreate(const char* sockName,
45 TSKM_SRV_SOCK_CTX_t* p_sock);
46 TSKM_SRV_CONNENT_t* tskm_srvSockConnect(TSKM_SRV_SOCK_CTX_t* p_sock);
47 void tskm_srvSockDisconnect(TSKM_SRV_SOCK_CTX_t* p_sock,
48 TSKM_SRV_CONNENT_t *p_conn);
49 void tskm_srvSockDestory(TSKM_SRV_SOCK_CTX_t* p_sock);
50 int tskm_cliSockConnect(const char* sockName);
51 int tskm_sockRcv(int fd, TSKM_EVENT_INFO_t* p_ev);
52 int tskm_sockSend(int fd, TSKM_EVENT_INFO_t* p_ev);
53 void tskm_sockDestory(int fd);
55 int tskm_comm_procInit(void);
56 int tskm_comm_setSvcWatchState(uint32_t id, BOOL bIsRun, uint32_t timeout);
58 #endif // TASK_MANAGER_SERVER_INCLUDE_TSKM_COMM_H_