diff options
author | 2020-10-22 13:28:36 +0900 | |
---|---|---|
committer | 2020-10-22 13:28:36 +0900 | |
commit | 211696c95c1ec3fc48e0096d47d4278910274195 (patch) | |
tree | f3e0a5461f83a0ec191b788070fe59639148fb17 /communication/client_can/include | |
parent | aacd1728939f2b6f4c811cd93502966265cd8203 (diff) |
ps-communication branch 0.1sandbox/ToshikazuOhiwa/ps-communication
Diffstat (limited to 'communication/client_can/include')
6 files changed, 194 insertions, 469 deletions
diff --git a/communication/client_can/include/API_Local_Common.h b/communication/client_can/include/API_Local_Common.h new file mode 100644 index 00000000..c5e3f780 --- /dev/null +++ b/communication/client_can/include/API_Local_Common.h @@ -0,0 +1,55 @@ +/* + * @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. + */ + +#ifndef COMMUNICATION_CLIENT_CAN_INCLUDE_API_LOCAL_COMMON_H_ +#define COMMUNICATION_CLIENT_CAN_INCLUDE_API_LOCAL_COMMON_H_ +#include <string.h> +enum CANIF_PROTOCOL_IDX { + CANIF_CAN = 0, + NUM_OF_CANIF_PROTOCOL +}; + +static inline const char *Canif_PidxTosname(enum CANIF_PROTOCOL_IDX idx) { + switch (idx) { + case CANIF_CAN: + return LAN_SERVICE_CAN; + break; + default: + return "Unknown"; + break; + } +} + +#define CANIF_NOTIFY_NAME_MAX_SIZE 15 +static inline bool Canif_CheckNotifyName(PCSTR notify_name) { + size_t n = CANIF_NOTIFY_NAME_MAX_SIZE + 1; + + if (!notify_name) + return false; + + return (strnlen(notify_name, n) < n); +} + +static inline bool Canif_CheckNotifyNameWithoutNullCheck(PCSTR notify_name) { + size_t n = CANIF_NOTIFY_NAME_MAX_SIZE + 1; + return (strnlen(notify_name, n) < n); +} + +static inline void Canif_CopyNotifyName(char *dest, PCSTR notify_name) { + strncpy(dest, notify_name, + strnlen(notify_name, CANIF_NOTIFY_NAME_MAX_SIZE)); +} +#endif diff --git a/communication/client_can/include/Canif_API_Local.h b/communication/client_can/include/Canif_API_Local.h index 9ab205ad..d17fcc50 100644 --- a/communication/client_can/include/Canif_API_Local.h +++ b/communication/client_can/include/Canif_API_Local.h @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. + * @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. @@ -14,90 +14,33 @@ * limitations under the License. */ -/**************************************************************************** - * FILE Canif_API_Local.h - * SYSTEM :_CWORD107_ - * SUBSYSTEM :Local header for CAN I/F provided APIs - * TITLE :Data header files needed to use the CAN I/F API - ****************************************************************************/ #ifndef COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_API_LOCAL_H_ #define COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_API_LOCAL_H_ -/************************************************************************ -* Definition * -************************************************************************/ - -/* CANDataControl code used in the transmission/reception relationship */ #define CAN_ID_MASK_CODE 0xE0000000UL // CAN ID Mask Codes +static inline bool Canif_CheckCanID(CANID id) { + if (id == 0) + return false; -/********************************************************************* -* Defining Return Values -***********************************************************************/ -/* Defined in Canif_API.h */ - -/********************************************************************* -* Defining Event Generation -***********************************************************************/ -#define CANIF_API_EVT_INIT 0 /* Initial value of the event */ -#define CANIF_API_ENT_EVT_MIN CANIF_RET_NORMAL /* Minimum Event Wait */ -#define CANIF_API_ENT_EVT_MAX CANIF_RET_ERROR_CREATE_EVENT /* Maximum value waiting for an event */ - -/********************************************************************* -* Type definition -***********************************************************************/ - -/*********************************************************************** -* CANIF API Functions Prototypes * -************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/** -* \~english Data struct used to transfer CAN data(_CWORD29_) -* \~english (transfer data from CANIF API to CAN) -*/ -typedef struct { - /** - * \~english Delivery target thread name - */ - char notifyName[MAX_NAME_SIZE_APP]; - /** - * \~english Resource ID - */ - uint8_t ucRid; - /** - * \~english Data size - */ - uint32_t ulDataSize; - /** - * \~english OPC - */ - uint16_t opc; - /** - * \~english Data buffer - */ - uint8_t data[CAN__CWORD29__MEM_SZ]; -} CAN__CWORD29__TRANS_MSG; + // upper 3 bit from MSB should be 0x0 + if ((CAN_ID_MASK_CODE & id) != 0x0) + return false; -/* The most significant part is defined in Canif_API.h. */ -CANIF_RET_API CanifDeliveryEntryCore(HANDLE h_app, PCSTR notify_name, uint8_t can_num, CANID *p_can_id, uint16_t cid); -CANIF_RET_API Canif_CWORD29_DeliveryEntryCore(const HANDLE h_app, const PCSTR notify_name, - const uint8_t opc_num, const uint16_t* const p_opc, const uint16_t cid); -CANIF_RET_API CanifTransmissionStartCore(HANDLE h_app, PCSTR notify_name, uint8_t rid, - uint16_t freq, CAN_DATA *p_data, uint16_t cid); -CANIF_RET_API CanifTransmissionStopCore(HANDLE h_app, PCSTR notify_name, CANID can_id, uint16_t cid); -CANIF_RET_API CanifCommandCtrlCore(HANDLE h_app, PCSTR notify_name, uint8_t rid, uint32_t cmd_id, uint16_t cid); -CANIF_RET_API CanifCommWatchCore(HANDLE h_app, PCSTR notify_name, CANID can_id, DID did, - uint8_t ig_cooperation, uint16_t watch_time, uint16_t cid); - -void CanifMsgHeaderGenerate(CAN_MSG_DATA *, uint16_t, uint16_t, uint16_t); /* Private Functions */ -CANIF_RET_API CanifSndMsg(CAN_MSG_DATA *); /* Private Functions */ - -CANIF_RET_API CanifCommWatchExtSndMsgData(uint16_t us_pid, CANID ul_canid, DID ul_did, - uint8_t uc_ig, uint16_t us_watch_time); /* Private Functions */ + return true; +} -#if defined(__cplusplus) +static inline bool Canif_IsCommand(uint32_t cmd_id) { + switch (cmd_id) { + case CAN_CMDID_FUELCALC_RST_REQ_DELIVERY: + case CAN_CMDID_STARTUP_FIN_REQ_TX: + case CAN_CMDID_MRST_INFO_REQ_TX: + case CAN_CMDID_VERSION_REQ_TX: + case CAN_CMDID_CONNECTION_NODE_REQ_TX: + case CAN_CMDID_FUELCALC_REQ_TX: + return true; + default: + return false; + } } -#endif + #endif // COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_API_LOCAL_H_ diff --git a/communication/client_can/include/Canif_TransmissionData.h b/communication/client_can/include/Canif_TransmissionData.h new file mode 100644 index 00000000..e9f82ac2 --- /dev/null +++ b/communication/client_can/include/Canif_TransmissionData.h @@ -0,0 +1,48 @@ +/* + * @copyright Copyright (c) 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. + */ + +#ifndef COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_TRANSMISSIONDATA_H_ +#define COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_TRANSMISSIONDATA_H_ + +#define LAN_TYPE_21PF "CAN_21PF" + +typedef struct { + uint8_t dlc; + CAN_DATA_BIT dat; +} CAN_TRANS_START_TABLE_VAL; + +typedef struct { + CANID canid; + CAN_TRANS_START_TABLE_VAL val; +} CAN_INIT_TABLE; + +#include "Canif_TransmissionData21PF.h" + +static inline bool Canif_InitDataIsDefined21PF(CANID id) { + int32_t count; + int i; + + count = sizeof(Can_TransInitData_21PF) / + sizeof(Can_TransInitData_21PF[0]); + for (i = 0; i < count; i++) { + if (id == Can_TransInitData_21PF[i].canid) + return true; + } + + return false; +} + +#endif // COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_TRANSMISSIONDATA_H_ diff --git a/communication/client_can/include/Canif_TransmissionData21PF.h b/communication/client_can/include/Canif_TransmissionData21PF.h new file mode 100644 index 00000000..e608ca58 --- /dev/null +++ b/communication/client_can/include/Canif_TransmissionData21PF.h @@ -0,0 +1,30 @@ +/* + * @copyright Copyright (c) 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. + */ + +// Following table could not be const because server will use this as R/W. +static CAN_INIT_TABLE Can_TransInitData_21PF[] __attribute__((unused)) = +{ + /* + * Note. + * This feature needs to be defined by the vendor. + */ + { 0x0000, 1, { 0x00 } }, + { 0x0001, 1, { 0x00 } }, + { 0x0002, 8, { 0x00 } }, + { 0x0100, 1, { 0x00 } }, + { 0x0101, 8, { 0x00 } }, + { 0x0102, 8, { 0x00 } } +}; diff --git a/communication/client_can/include/peripheral_service/Canif_API.h b/communication/client_can/include/peripheral_service/Canif_API.h index d522c5a1..a68783ca 100644 --- a/communication/client_can/include/peripheral_service/Canif_API.h +++ b/communication/client_can/include/peripheral_service/Canif_API.h @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. + * @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. @@ -48,12 +48,7 @@ #include <stdio.h> #include <unistd.h> #include <asm/unistd.h> -//#include <stub/com_message_header.h> - -/** - * \~english Debug defination for DeliveryEntry IT Test - */ -#define CAN_DEBUG +#include <stub/com_message_header.h> /** * \~english Defination of Service name @@ -112,6 +107,20 @@ #define CANIF_RET_ERROR_NULL 10 /** + * \~english Flags for specifiy Delivery is echoback or not. + */ +enum CanIfEchoBackFlags { + /** + * \~english Delivery is recv data + */ + CANIF_PURERECV = 0, + /** + * \~english Delivery is echo data + */ + CANIF_ECHOBACK = 1 +}; + +/** * \~english Defination of Command ID ( CAN -> user ) */ typedef enum _PS_CommunicationProtocol { @@ -132,14 +141,6 @@ typedef enum _PS_CommunicationProtocol { */ CID_CAN_TX_RESULT, /** - * \~english CAN _CWORD29_ transmission result - */ - CID_CAN__CWORD29__TX_RESULT, - /** - * \~english Delivery CAN data(_CWORD29_) - */ - CID_CAN_DIAG_CWORD29__DELIVERY, - /** * \~english Delivery CAN command */ CID_CAN_CMD_DELIVERY, @@ -162,26 +163,18 @@ typedef enum _PS_Communication_InternalProtocol { */ CID_CANIF_DELIVERY_ENTRY = 0x0501, /** - * \~english Delivery registration of _CWORD29_data + * \~english Delivery deregistration of CAN data */ - CID_CANIF__CWORD29__DELIVERY_ENTRY, + CID_CANIF_DELIVERY_ERASE, /** * \~english CAN data transmission start */ CID_CANIF_TX_START, /** - * \~english CAN data transmission stop - */ - CID_CANIF_TX_STOP, - /** * \~english CAN data communication stop watching */ CID_CANIF_COMM_WATCH, /** - * \~english CAN data(_CWORD29_) transmission - */ - CID_CANIF__CWORD29__TX_START, - /** * \~english CAN command control */ CID_CANIF_CMD_CTRL, @@ -189,28 +182,8 @@ typedef enum _PS_Communication_InternalProtocol { * \~english CAN data transmission start */ CID_CANIF_TX_BIT_START, - /** - * \~english CAN data regular transmission stop - */ - CID_CANIF_TX_BIT_STOP, } PS_Communication_InternalProtocol; -#ifdef CAN_DEBUG -/** - * \~english Defination of Command ID (Used for debug) - */ -typedef enum _PS_Communication_Internal_DebugProtocol { - /** - * \~english Delivery unregister (Used for debug) - */ - CID_CANIF_DELETE_DELIVERY_ENTRY = 0x0511, - /** - * \~english CANIF communication data all clear(Used for debug) - */ - CID_CANIF_COMMWATCH_CLEAR_FOR_DEBUG -} PS_Communication_Internal_DebugProtocol; -#endif - /********************************************************************* * Definitions of CAN command IDs ***********************************************************************/ @@ -370,11 +343,6 @@ typedef enum _PS_Communication_Internal_DebugProtocol { */ #define CANGW_DLC_MAX_SIZE 0x08 -/** -* \~english Memory size used for _CWORD29_ can data -*/ -#define CAN__CWORD29__MEM_SZ (4100) - /********************************************************************* * Type definition ***********************************************************************/ @@ -427,11 +395,15 @@ typedef struct { /** * \~english header */ -// T_APIMSG_MSGBUF_HEADER_COMM hdr; + T_APIMSG_MSGBUF_HEADER_COMM hdr; /** * \~english data */ CAN_MSG_CANDATA_DAT data; + /** + * \~english echoback flag + */ + enum CanIfEchoBackFlags echoback; } CAN_MSG_CANDATA; /** @@ -458,15 +430,6 @@ typedef struct { } CAN_MSG_CANGWDATA_DAT; /** - * \~english Data struct used to transfer CAN _CWORD29_ data.(transfer data from CAN to user) - */ -typedef struct { - uint16_t opc; //!< \~english OPC - uint32_t dlc; //!< \~english Data length(1~4100) - uint8_t data[CAN__CWORD29__MEM_SZ]; //!< \~english Data buffer -} CAN_MSG_CAN__CWORD29_DATA; - -/** * \~english Message struct used to transfer CAN data to CANGW * \~english (transfer message from CAN to user) */ @@ -559,7 +522,7 @@ typedef struct { /** * \~english header */ -// T_APIMSG_MSGBUF_HEADER_COMM hdr; + T_APIMSG_MSGBUF_HEADER_COMM hdr; /** * \~english Data */ @@ -567,40 +530,6 @@ typedef struct { } CAN_MSG_SENDSTS; /** -* \~english Data struct used to notify _CWORD29_ transmission result -* \~english (transfer data from CAN API to user) -*/ -typedef struct { - /** - * \~english OPC - */ - uint16_t usOpc; - /** - * \~english Transmission result status - */ - uint8_t ucStatus; - /** - * \~english Reserve - */ - uint8_t reserve[1]; -} CAN_MSG__CWORD29__SENDSTS_DAT; - -/** -* \~english Message struct used to notify _CWORD29_ transmission result -* \~english (transfer message from CAN API to user) -*/ -typedef struct { - /** - * \~english header - */ -// T_APIMSG_MSGBUF_HEADER_COMM hdr; - /** - * \~english Data - */ - CAN_MSG__CWORD29__SENDSTS_DAT data; -} CAN_MSG__CWORD29__SENDSTS; - -/** * \~english Data struct used for regular transmission stop * \~english (transfer data from CANIF API to CAN) */ @@ -639,7 +568,7 @@ typedef struct { /** * \~english Header */ -// T_APIMSG_MSGBUF_HEADER_COMM hdr; + T_APIMSG_MSGBUF_HEADER_COMM hdr; /** * \~english Data */ @@ -671,25 +600,6 @@ typedef struct { } CAN_DELIVERY_ENTRY; /** -* \~english _CWORD29_data struct used for delivery entry -* \~english (transfer data from CANIF API to CAN) -*/ -typedef struct { - /** - * \~english Delivery target thread name - */ - char notifyName[MAX_NAME_SIZE_APP]; - /** - * \~english Number of OPC entry - */ - uint16_t usOpcNum; - /** - * \~english OPC entry array - */ - uint16_t usOpc[CAN_DELIVERY_OPC_ENTRY_MAX]; -} CAN__CWORD29__DELIVERY_ENTRY; - -/** * \~english Data struct used for communication stop * \~english (transfer data from CANIF API to CAN) */ @@ -767,7 +677,7 @@ typedef struct { /** * \~english Header */ -// T_APIMSG_MSGBUF_HEADER_COMM hdr; + T_APIMSG_MSGBUF_HEADER_COMM hdr; /** * \~english Data */ @@ -801,7 +711,7 @@ typedef struct { /** * \~english Header */ -// T_APIMSG_MSGBUF_HEADER_COMM hdr; + T_APIMSG_MSGBUF_HEADER_COMM hdr; /** * \~english Data */ @@ -815,7 +725,7 @@ typedef struct { /** * \~english Header */ -// T_APIMSG_MSGBUF_HEADER_COMM stHead; + T_APIMSG_MSGBUF_HEADER_COMM stHead; /** * \~english Data */ @@ -960,62 +870,6 @@ CANIF_RET_API Canif_DeliveryEntry(HANDLE h_app, PCSTR notify_name, uint8_t can_num, CANID *p_can_id); /******************************************************************************* - * MODULE : Canif_Diag_CWORD29_DeliveryEntry - ******************************************************************************/ -//////////////////////////////////////////////////////////////////////////////// -/// \ingroup Canif_Diag_CWORD29_DeliveryEntry -/// \~english @par Brief -/// Delivery registration of _CWORD29_data -/// \~english @param [in] h_app -/// const HANDLE - Handle for application -/// \~english @param [in] notify_name -/// const PCSTR - Delivery target thread name -/// \~english @param [in] opc_num -/// const uint8_t - Number of delivery registration OPC -/// \~english @param [in] p_opc -/// const uint16_t* const - Pointer of delivery registration OPC array -/// \~english @retval CANIF_RET_NORMAL Normality -/// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter -/// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination -/// \~english @par Prerequisite -/// None -/// \~english @par Change of internal state -/// - Change of internal state according to the API does not occur -/// \~english @par Conditions of processing failure -/// - h_app is NULL.[CANIF_RET_ERROR_PARAM] -/// - notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes. -/// [CANIF_RET_ERROR_PARAM] -/// - opc_num is 0.[CANIF_RET_ERROR_PARAM] -/// - OPC pointer is null.[CANIF_RET_ERROR_PARAM] -/// - malloc failed to get the message queue management information area -/// for transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - malloc failed to get the message queue name storage area for -/// transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - mq_open failed to open the message queue for transmission -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - The session message queue to communication service is full. -/// [CANIF_RET_ERROR_CANCEL] -/// - The transmission file descriptor of the session -/// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL] -/// - The interruption by the system call (signal) occurred while -/// transmitting the session message to communication service. -/// [CANIF_RET_ERROR_CANCEL] -/// - Any error occurred in the transmission of the session message -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - It failed to access to the shared memory for the transmission of -/// session message to communication service. [CANIF_RET_ERROR_CANCEL] -/// \~english @par Classification -/// Public -/// \~english @par Type -/// Sync -/// \~english @par Detail -/// - Delivery registration of _CWORD29_data. \n -/// \~english @see None -//////////////////////////////////////////////////////////////////////////////// -CANIF_RET_API Canif_Diag_CWORD29_DeliveryEntry(const HANDLE h_app, const PCSTR notify_name, - const uint8_t opc_num, const uint16_t* const p_opc); - -/******************************************************************************* * MODULE : Canif_TransmissionStart ******************************************************************************/ //////////////////////////////////////////////////////////////////////////////// @@ -1046,6 +900,8 @@ CANIF_RET_API Canif_Diag_CWORD29_DeliveryEntry(const HANDLE h_app, const PCSTR n /// - Transmission data pointer is null.[CANIF_RET_ERROR_PARAM] /// - DLC size is bigger than 8 bytes.[CANIF_RET_ERROR_PARAM] /// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM] +/// - CAN ID is not defined in the _CWORD108_ bit asignment table +/// [CANIF_RET_ERROR_PARAM] /// - malloc failed to get the message queue management information area /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL] /// - malloc failed to get the message queue name storage area for @@ -1075,122 +931,6 @@ CANIF_RET_API Canif_TransmissionStart(HANDLE h_app, PCSTR notify_name, uint8_t rid, uint16_t freq, CAN_DATA *p_data); /******************************************************************************* - * MODULE : Canif_TransmissionStop - ******************************************************************************/ -//////////////////////////////////////////////////////////////////////////////// -/// \ingroup Canif_TransmissionStop -/// \~english @par Brief -/// CAN data regular transmission stop -/// \~english @param [in] h_app -/// HANDLE - Handle for application -/// \~english @param [in] notify_name -/// PCSTR - Delivery target thread name -/// \~english @param [in] can_id -/// CANID - CAN ID -/// \~english @retval CANIF_RET_NORMAL Normality -/// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter -/// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination -/// \~english @par Prerequisite -/// None -/// \~english @par Change of internal state -/// - Change of internal state according to the API does not occur -/// \~english @par Conditions of processing failure -/// - h_app is NULL.[CANIF_RET_ERROR_PARAM] -/// -notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes. -/// [CANIF_RET_ERROR_PARAM] -/// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM] -/// - malloc failed to get the message queue management information area -/// for transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - malloc failed to get the message queue name storage area for -/// transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - mq_open failed to open the message queue for transmission -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - The session message queue to communication service is full. -/// [CANIF_RET_ERROR_CANCEL] -/// - The transmission file descriptor of the session -/// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL] -/// - The interruption by the system call (signal) occurred while -/// transmitting the session message to communication service. -/// [CANIF_RET_ERROR_CANCEL] -/// - Any error occurred in the transmission of the session message -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - It failed to access to the shared memory for the transmission of -/// session message to communication service. [CANIF_RET_ERROR_CANCEL] -/// \~english @par Classification -/// Public -/// \~english @par Type -/// Sync -/// \~english @par Detail -/// - CAN data regular transmission stop. \n -/// \~english @see None -//////////////////////////////////////////////////////////////////////////////// -CANIF_RET_API Canif_TransmissionStop(HANDLE h_app, PCSTR notify_name, CANID can_id); - -/******************************************************************************* - * MODULE : Canif_Diag_CWORD29_Transmission - ******************************************************************************/ -//////////////////////////////////////////////////////////////////////////////// -/// \ingroup Canif_Diag_CWORD29_Transmission -/// \~english @par Brief -/// Transmission of CAN data (_CWORD29_) transmission -/// \~english @param [in] h_app -/// HANDLE - Handle for application -/// \~english @param [in] notify_name -/// PCSTR - Delivery target thread name -/// \~english @param [in] opc -/// const uint16_t - OPC -/// \~english @param [in] rid -/// uint8_t - Resource ID -/// \~english @param [in] data_size -/// uint32_t - Data size -/// \~english @param [in] p_data -/// uint8_t* - Pointer of transmission data -/// \~english @retval CANIF_RET_NORMAL Normality -/// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter -/// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination -/// \~english @par Prerequisite -/// None -/// \~english @par Change of internal state -/// - Change of internal state according to the API does not occur -/// \~english @par Conditions of processing failure -/// - h_app is NULL.[CANIF_RET_ERROR_PARAM] -/// -notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes. -/// [CANIF_RET_ERROR_PARAM] -/// - Transmission data pointer is null.[CANIF_RET_ERROR_PARAM] -/// - DLC size is bigger than 8 bytes.[CANIF_RET_ERROR_PARAM] -/// - malloc failed to get the message queue management information area -/// for transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - malloc failed to get the message queue name storage area for -/// transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - mq_open failed to open the message queue for transmission -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - The session message queue to communication service is full. -/// [CANIF_RET_ERROR_CANCEL] -/// - The transmission file descriptor of the session -/// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL] -/// - The interruption by the system call (signal) occurred while -/// transmitting the session message to communication service. -/// [CANIF_RET_ERROR_CANCEL] -/// - Any error occurred in the transmission of the session message -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - It failed to access to the shared memory for the transmission of -/// session message to communication service. [CANIF_RET_ERROR_CANCEL] -/// \~english @par Classification -/// Public -/// \~english @par Type -/// ASync -/// \~english @par Detail -/// - Transmission of CAN data (_CWORD29_) transmission notification. \n -/// \~english @see None -//////////////////////////////////////////////////////////////////////////////// -CANIF_RET_API Canif_Diag_CWORD29_Transmission(HANDLE h_app, - PCSTR notify_name, - const uint16_t opc, - uint8_t rid, - uint32_t data_size, - uint8_t *p_data); - -/******************************************************************************* * MODULE : Canif_CommandCtrl ******************************************************************************/ //////////////////////////////////////////////////////////////////////////////// @@ -1329,6 +1069,8 @@ CANIF_RET_API Canif_CommWatch(HANDLE h_app, PCSTR notify_name, CANID can_id, /// - CAN ID is NULL.[CANIF_RET_ERROR_PARAM] /// - Mask Data is NULL.[CANIF_RET_ERROR_PARAM] /// - Transmission Data is NULL.[CANIF_RET_ERROR_PARAM] +/// - CAN ID is not defined in the _CWORD108_ bit asignment table +/// [CANIF_RET_ERROR_PARAM] /// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM] /// - malloc failed to get the message queue management information area /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL] @@ -1359,107 +1101,13 @@ CANIF_RET_API Canif_TransStart(HANDLE h_app, CANID can_id, CAN_DATA_MASK *mask, CAN_DATA_BIT *dat, uint32_t freq); //////////////////////////////////////////////////////////////////////////////// -/// \ingroup Canif_TransStop -/// \~english @par Brief -/// Stop periodic transmission of CAN Command -/// \~english @param [in] h_app -/// HANDLE - Handle for application -/// \~english @param [in] can_id -/// CANID - CAN ID -/// \~english @retval CANIF_RET_NORMAL Normality -/// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter -/// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination -/// \~english @par Prerequisite -/// None -/// \~english @par Change of internal state -/// - Change of internal state according to the API does not occur -/// \~english @par Conditions of processing failure -/// - h_app is NULL.[CANIF_RET_ERROR_PARAM] -/// - can_id is NULL.[CANIF_RET_ERROR_PARAM] -/// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM] -/// - malloc failed to get the message queue management information area -/// for transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - malloc failed to get the message queue name storage area for -/// transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - mq_open failed to open the message queue for transmission -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - The session message queue to communication service is full. -/// [CANIF_RET_ERROR_CANCEL] -/// - The transmission file descriptor of the session -/// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL] -/// - The interruption by the system call (signal) occurred while -/// transmitting the session message to communication service. -/// [CANIF_RET_ERROR_CANCEL] -/// - Any error occurred in the transmission of the session message -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - It failed to access to the shared memory for the transmission of -/// session message to communication service. [CANIF_RET_ERROR_CANCEL] -/// \~english @par Classification -/// Public -/// \~english @par Type -/// Sync -/// \~english @par Detail -/// - Stop periodic Transmission of CAN Command API. \n -/// \~english @see None -//////////////////////////////////////////////////////////////////////////////// -CANIF_RET_API Canif_TransStop(HANDLE h_app, CANID can_id); - -//////////////////////////////////////////////////////////////////////////////// -/// \ingroup Canif_Send -/// \~english @par Brief -/// Transmission CAN Command(for OpeningMovie) -/// \~english @param [in] can_id -/// CANID - CAN ID -/// \~english @param [in] mask -/// CAN_DATA_MASK* - Mask Data -/// \~english @param [in] dat -/// CAN_DATA_BIT* - Transmission Data -/// \~english @retval CANIF_RET_NORMAL Normality -/// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter -/// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination -/// \~english @par Prerequisite -/// None -/// \~english @par Change of internal state -/// - Change of internal state according to the API does not occur -/// \~english @par Conditions of processing failure -/// - h_app is NULL.[CANIF_RET_ERROR_PARAM] -/// - Mask Data is NULL.[CANIF_RET_ERROR_PARAM] -/// - Transmission Data is NULL.[CANIF_RET_ERROR_PARAM] -/// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM] -/// - malloc failed to get the message queue management information area -/// for transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - malloc failed to get the message queue name storage area for -/// transmission to communication service. [CANIF_RET_ERROR_CANCEL] -/// - mq_open failed to open the message queue for transmission -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - The session message queue to communication service is full. -/// [CANIF_RET_ERROR_CANCEL] -/// - The transmission file descriptor of the session -/// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL] -/// - The interruption by the system call (signal) occurred while -/// transmitting the session message to communication service. -/// [CANIF_RET_ERROR_CANCEL] -/// - Any error occurred in the transmission of the session message -/// to communication service. [CANIF_RET_ERROR_CANCEL] -/// - It failed to access to the shared memory for the transmission of -/// session message to communication service. [CANIF_RET_ERROR_CANCEL] -/// \~english @par Classification -/// Public -/// \~english @par Type -/// ASync -/// \~english @par Detail -/// - CAN Command Send API. \n -/// \~english @see None -//////////////////////////////////////////////////////////////////////////////// -CANIF_RET_API Canif_Send(CANID can_id, CAN_DATA_MASK *mask, CAN_DATA_BIT *dat); - -#ifdef CAN_DEBUG -//////////////////////////////////////////////////////////////////////////////// -/// \ingroup Canif_Debug_Delete_AllDeliveryEntryList +/// \ingroup Canif_DeliveryEraseAll /// \~english @par Brief /// Delete all delivery entry /// \~english @param [in] h_app /// HANDLE - Handle for application +/// \~english @param [in] notify_name +/// PCSTR - Delivery target thread name /// \~english @retval CANIF_RET_NORMAL Normality /// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter /// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination @@ -1469,6 +1117,8 @@ CANIF_RET_API Canif_Send(CANID can_id, CAN_DATA_MASK *mask, CAN_DATA_BIT *dat); /// - Change of internal state according to the API does not occur /// \~english @par Conditions of processing failure /// - h_app is NULL.[CANIF_RET_ERROR_PARAM] +/// -notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes. +/// [CANIF_RET_ERROR_PARAM] /// - malloc failed to get the message queue management information area /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL] /// - malloc failed to get the message queue name storage area for @@ -1494,8 +1144,7 @@ CANIF_RET_API Canif_Send(CANID can_id, CAN_DATA_MASK *mask, CAN_DATA_BIT *dat); /// - Delete all delivery entry. \n /// \~english @see None //////////////////////////////////////////////////////////////////////////////// -CANIF_RET_API Canif_Debug_Delete_AllDeliveryEntryList(HANDLE h_app); -#endif +CANIF_RET_API Canif_DeliveryEraseAll(HANDLE h_app, PCSTR notify_name); /** @}*/ // end of CAN /** @}*/ // end of communication diff --git a/communication/client_can/include/peripheral_service/communication_can.h b/communication/client_can/include/peripheral_service/communication_can.h index 59cc1bd2..8b6119a2 100644 --- a/communication/client_can/include/peripheral_service/communication_can.h +++ b/communication/client_can/include/peripheral_service/communication_can.h @@ -1,5 +1,5 @@ // -// @copyright Copyright (c) 2017-2019 TOYOTA MOTOR CORPORATION. +// @copyright Copyright (c) 2017-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. |