X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=service%2Fsystem%2Ftask_manager%2Fserver%2Finclude%2Ftskm_comm.h;fp=service%2Fsystem%2Ftask_manager%2Fserver%2Finclude%2Ftskm_comm.h;h=c884be964e0d3ad072d7245f191f8b966f1c2f7a;hb=17cf21bcf8a2e29d2cbcf0a313474d2a4ee44f5d;hp=0000000000000000000000000000000000000000;hpb=9e86046cdb356913ae026f616e5bf17f6f238aa5;p=staging%2Fbasesystem.git diff --git a/service/system/task_manager/server/include/tskm_comm.h b/service/system/task_manager/server/include/tskm_comm.h new file mode 100755 index 0000000..c884be9 --- /dev/null +++ b/service/system/task_manager/server/include/tskm_comm.h @@ -0,0 +1,59 @@ +/* + * @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. + */ + +// Communication module header file +#ifndef TASK_MANAGER_SERVER_INCLUDE_TSKM_COMM_H_ +#define TASK_MANAGER_SERVER_INCLUDE_TSKM_COMM_H_ + +#include +#include "system_service/tskm_local_type.h" + +#define TSKM_SOCKET_NAME "/tmp/tskm_sock" // Sockets for Primary Library + +#define TSKM_COMM_CONNECT_MAX (32) + +typedef struct { + pid_t pid; + int connFd; +} TSKM_SRV_CONNENT_t; + +typedef struct { + uint32_t num; + TSKM_SRV_CONNENT_t conn[TSKM_COMM_CONNECT_MAX]; +} TSKM_SRV_CONNENT_LIST_t; + +typedef struct { + int sockFd; + const char *sockName; + TSKM_SRV_CONNENT_LIST_t connList; +} TSKM_SRV_SOCK_CTX_t; + +TSKM_ERR_t tskm_srvSockCreate(const char* sockName, + TSKM_SRV_SOCK_CTX_t* p_sock); +TSKM_SRV_CONNENT_t* tskm_srvSockConnect(TSKM_SRV_SOCK_CTX_t* p_sock); +void tskm_srvSockDisconnect(TSKM_SRV_SOCK_CTX_t* p_sock, + TSKM_SRV_CONNENT_t *p_conn); +void tskm_srvSockDestory(TSKM_SRV_SOCK_CTX_t* p_sock); +int tskm_cliSockConnect(const char* sockName); +int tskm_sockRcv(int fd, TSKM_EVENT_INFO_t* p_ev); +int tskm_sockSend(int fd, TSKM_EVENT_INFO_t* p_ev); +void tskm_sockDestory(int fd); + +int tskm_comm_procInit(void); +int tskm_comm_setSvcWatchState(uint32_t id, BOOL bIsRun, uint32_t timeout); + +#endif // TASK_MANAGER_SERVER_INCLUDE_TSKM_COMM_H_ +