From 738c1d56adb80ac3623251a47a7c5f2d4db57193 Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Thu, 15 Apr 2021 11:17:32 +0000 Subject: Initial commit for AGL cluster ipc library This source code is AGL instrument cluster common ipc library. Currently, this source code is missing author information, license and other. Will be add by author. Author: Nozomu Abe (nozo_abe@nippon-seiki.co.jp) Committed by Naoto Yamaguchi. Signed-off-by: Naoto Yamaguchi --- include/ipc.h | 32 +++++++++++ include/ipc_protocol.h | 148 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 include/ipc.h create mode 100644 include/ipc_protocol.h (limited to 'include') diff --git a/include/ipc.h b/include/ipc.h new file mode 100644 index 0000000..d1bc90d --- /dev/null +++ b/include/ipc.h @@ -0,0 +1,32 @@ +#ifndef IPC_H +#define IPC_H + +#include + +// Environment Variable for unix-domain-socket file path +#define IPC_ENV_DOMAIN_SOCKET_PATH "IPC_DOMAIN_PATH" + +// return value for API +typedef enum { + IPC_RET_OK = 0, + IPC_ERR_PARAM, + IPC_ERR_SEQUENCE, + IPC_ERR_NO_RESOURCE, + IPC_ERR_OTHER +} IPC_RET_E; + +// format of callback function +typedef void (*IPC_CHANGE_NOTIFY_CB)(void* pData, signed int size, int kind); + +// for Server Function +IPC_RET_E ipcServerStart(IPC_USAGE_TYPE_E usageType); +IPC_RET_E ipcSendMessage(IPC_USAGE_TYPE_E usageType, const void* pData, signed int size); +IPC_RET_E ipcServerStop(IPC_USAGE_TYPE_E usageType); + +// for Client Function +IPC_RET_E ipcClientStart(IPC_USAGE_TYPE_E usageType); +IPC_RET_E ipcReadDataPool(IPC_USAGE_TYPE_E usageType, void* pData, signed int* pSize); +IPC_RET_E ipcRegisterCallback(IPC_USAGE_TYPE_E usageType, IPC_CHANGE_NOTIFY_CB changeNotifyCb); +IPC_RET_E ipcClientStop(IPC_USAGE_TYPE_E usageType); + +#endif // IPC_H diff --git a/include/ipc_protocol.h b/include/ipc_protocol.h new file mode 100644 index 0000000..c0ad861 --- /dev/null +++ b/include/ipc_protocol.h @@ -0,0 +1,148 @@ +#ifndef IPC_PROTOCOL_H +#define IPC_PROTOCOL_H + +// TODO: Write something + +typedef enum { + IPC_USAGE_TYPE_IC_SERVICE = 0, + IPC_USAGE_TYPE_FOR_TEST, + IPC_USAGE_TYPE_MAX +} IPC_USAGE_TYPE_E; + +// for IPC_USAGE_TYPE_IC_SERVICE +typedef enum { + IPC_KIND_ICS_TURN_R = 0, + IPC_KIND_ICS_TURN_L, + IPC_KIND_ICS_BRAKE, + IPC_KIND_ICS_SEATBELT, + IPC_KIND_ICS_HIGHBEAM, + IPC_KIND_ICS_DOOR, + IPC_KIND_ICS_EPS, + IPC_KIND_ICS_SRS_AIRBAG, + IPC_KIND_ICS_ABS, + IPC_KIND_ICS_LOW_BATTERY, + IPC_KIND_ICS_OIL_PRESS, + IPC_KIND_ICS_ENGINE, + IPC_KIND_ICS_FUEL, + IPC_KIND_ICS_IMMOBI, + IPC_KIND_ICS_TM_FAIL, + IPC_KIND_ICS_ESP_ACT, + IPC_KIND_ICS_ESP_OFF, + IPC_KIND_ICS_ADAPTING_LIGHTING, + IPC_KIND_ICS_AUTO_STOP, + IPC_KIND_ICS_AUTO_STOP_FAIL, + IPC_KIND_ICS_PARKING_LIGHTS, + IPC_KIND_ICS_FRONT_FOG, + IPC_KIND_ICS_EXTERIOR_LIGHT_FAULT, + IPC_KIND_ICS_ACC_FAIL, + IPC_KIND_ICS_LDW_OFF, + IPC_KIND_ICS_HILL_DESCENT, + IPC_KIND_ICS_AUTO_HI_BEAM_GREEN, + IPC_KIND_ICS_AUTO_HI_BEAM_AMBER, + IPC_KIND_ICS_LDW_OPERATE, + IPC_KIND_ICS_GENERAL_WARN, + IPC_KIND_ICS_SPORTS_MODE, + IPC_KIND_ICS_DRIVING_POWER_MODE, + IPC_KIND_ICS_HOT_TEMP, + IPC_KIND_ICS_LOW_TEMP +} IPC_KIND_IC_SERVICE_E; + +typedef struct { + // Telltale + signed int turnR; + signed int turnL; + signed int brake; + signed int seatbelt; + signed int frontRightSeatbelt; + signed int frontCenterSeatbelt; + signed int frontLeftSeatbelt; + signed int mid1RightSeatbelt; + signed int mid1CenterSeatbelt; + signed int mid1LeftSeatbelt; + signed int mid2RightSeatbelt; + signed int mid2CenterSeatbelt; + signed int mid2LeftSeatbelt; + signed int rearRightSeatbelt; + signed int rearCenterSeatbelt; + signed int rearLeftSeatbelt; + signed int highbeam; + signed int door; + signed int frontRightDoor; + signed int frontLeftDoor; + signed int rearRightDoor; + signed int rearLeftDoor; + signed int trunkDoor; + signed int hoodDoor; + signed int eps; + signed int srsAirbag; + signed int abs; + signed int lowBattery; + signed int oilPress; + signed int engine; + signed int fuel; + signed int immobi; + signed int tmFail; + signed int espAct; + signed int espOff; + signed int adaptingLighting; + signed int autoStop; + signed int autoStopFail; + signed int parkingLights; + signed int frontFog; + signed int exteriorLightFault; + signed int accFail; + signed int ldwOff; + signed int hillDescent; + signed int autoHiBeamGreen; + signed int autoHiBeamAmber; + signed int sportsMode; + signed int ldwOperate; + signed int generalWarn; + signed int drivingPowerMode; + signed int hotTemp; + signed int lowTemp; + + // ShiftPosition + signed int gearAtVal; + signed int gearMtVal; + + // Speed + unsigned long spAnalogVal; + signed int spAnaDigUnitVal; + + // Tacho + unsigned long taAnalogVal; + + // TripComputer + unsigned long trcomTripAVal; + unsigned long trcomTripBVal; + unsigned long trcomOdoVal; + signed int trcomUnitVal; + unsigned short avgSpeedAVal; + unsigned short avgSpeedBVal; + unsigned short hourAVal; + unsigned short hourBVal; + unsigned char minuteAVal; + unsigned char minuteBVal; + unsigned char secondAVal; + unsigned char secondBVal; + signed short oTempVal; + signed int oTempUnitVal; + unsigned short cruRangeVal; + unsigned short avgFuelAVal; + unsigned short avgFuelBVal; + unsigned short insFuelAVal; + unsigned short insFuelBVal; + signed int fuelEconomyUnitVal; +} IPC_DATA_IC_SERVICE_S; + +// for IPC_USAGE_TYPE_FOR_TEST +typedef enum { + IPC_KIND_TEST_TEST = 0 +} IPC_KIND_FOR_TEST_E; + +typedef struct { + signed int test; +} IPC_DATA_FOR_TEST_S; + +#endif // IPC_PROTOCOL_H -- cgit From c2aff1efa31287c8e26049319c06e4dcab82dc3e Mon Sep 17 00:00:00 2001 From: MasanoriMaruyama <82852796+MasanoriMaruyama@users.noreply.github.com> Date: Mon, 24 May 2021 16:42:29 +0900 Subject: Add license and Author information --- include/ipc.h | 17 +++++++++++++++++ include/ipc_protocol.h | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'include') diff --git a/include/ipc.h b/include/ipc.h index d1bc90d..64b731c 100644 --- a/include/ipc.h +++ b/include/ipc.h @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2021, Nippon Seiki Co., Ltd. + * SPDX-License-Identifier: Apache-2.0 + * + * 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. + */ + #ifndef IPC_H #define IPC_H diff --git a/include/ipc_protocol.h b/include/ipc_protocol.h index c0ad861..dc703d0 100644 --- a/include/ipc_protocol.h +++ b/include/ipc_protocol.h @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2021, Nippon Seiki Co., Ltd. + * SPDX-License-Identifier: Apache-2.0 + * + * 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. + */ + #ifndef IPC_PROTOCOL_H #define IPC_PROTOCOL_H -- cgit From da8e71cb35ed0ba62f39bf2abcb5055016874b03 Mon Sep 17 00:00:00 2001 From: t-kmt123 Date: Tue, 6 Jul 2021 14:16:38 +0900 Subject: rename libipc --- include/cluster_ipc.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ include/ipc.h | 49 ------------------------------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 include/cluster_ipc.h delete mode 100644 include/ipc.h (limited to 'include') diff --git a/include/cluster_ipc.h b/include/cluster_ipc.h new file mode 100644 index 0000000..64b731c --- /dev/null +++ b/include/cluster_ipc.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021, Nippon Seiki Co., Ltd. + * SPDX-License-Identifier: Apache-2.0 + * + * 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. + */ + +#ifndef IPC_H +#define IPC_H + +#include + +// Environment Variable for unix-domain-socket file path +#define IPC_ENV_DOMAIN_SOCKET_PATH "IPC_DOMAIN_PATH" + +// return value for API +typedef enum { + IPC_RET_OK = 0, + IPC_ERR_PARAM, + IPC_ERR_SEQUENCE, + IPC_ERR_NO_RESOURCE, + IPC_ERR_OTHER +} IPC_RET_E; + +// format of callback function +typedef void (*IPC_CHANGE_NOTIFY_CB)(void* pData, signed int size, int kind); + +// for Server Function +IPC_RET_E ipcServerStart(IPC_USAGE_TYPE_E usageType); +IPC_RET_E ipcSendMessage(IPC_USAGE_TYPE_E usageType, const void* pData, signed int size); +IPC_RET_E ipcServerStop(IPC_USAGE_TYPE_E usageType); + +// for Client Function +IPC_RET_E ipcClientStart(IPC_USAGE_TYPE_E usageType); +IPC_RET_E ipcReadDataPool(IPC_USAGE_TYPE_E usageType, void* pData, signed int* pSize); +IPC_RET_E ipcRegisterCallback(IPC_USAGE_TYPE_E usageType, IPC_CHANGE_NOTIFY_CB changeNotifyCb); +IPC_RET_E ipcClientStop(IPC_USAGE_TYPE_E usageType); + +#endif // IPC_H diff --git a/include/ipc.h b/include/ipc.h deleted file mode 100644 index 64b731c..0000000 --- a/include/ipc.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021, Nippon Seiki Co., Ltd. - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - */ - -#ifndef IPC_H -#define IPC_H - -#include - -// Environment Variable for unix-domain-socket file path -#define IPC_ENV_DOMAIN_SOCKET_PATH "IPC_DOMAIN_PATH" - -// return value for API -typedef enum { - IPC_RET_OK = 0, - IPC_ERR_PARAM, - IPC_ERR_SEQUENCE, - IPC_ERR_NO_RESOURCE, - IPC_ERR_OTHER -} IPC_RET_E; - -// format of callback function -typedef void (*IPC_CHANGE_NOTIFY_CB)(void* pData, signed int size, int kind); - -// for Server Function -IPC_RET_E ipcServerStart(IPC_USAGE_TYPE_E usageType); -IPC_RET_E ipcSendMessage(IPC_USAGE_TYPE_E usageType, const void* pData, signed int size); -IPC_RET_E ipcServerStop(IPC_USAGE_TYPE_E usageType); - -// for Client Function -IPC_RET_E ipcClientStart(IPC_USAGE_TYPE_E usageType); -IPC_RET_E ipcReadDataPool(IPC_USAGE_TYPE_E usageType, void* pData, signed int* pSize); -IPC_RET_E ipcRegisterCallback(IPC_USAGE_TYPE_E usageType, IPC_CHANGE_NOTIFY_CB changeNotifyCb); -IPC_RET_E ipcClientStop(IPC_USAGE_TYPE_E usageType); - -#endif // IPC_H -- cgit