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 /****************************************************************************
19 * TITLE :Data header files needed to use the CAN I/F API
20 ****************************************************************************/
22 #ifndef COMMUNICATION_CLIENT_CAN_INCLUDE_PERIPHERAL_SERVICE_CANIF_API_H_
23 #define COMMUNICATION_CLIENT_CAN_INCLUDE_PERIPHERAL_SERVICE_CANIF_API_H_
28 * @brief Canif API header
31 /** @addtogroup BaseSystem
34 /** @addtogroup peripheral_service
38 /** @addtogroup communication
39 * @ingroup peripheral_service
43 * @ingroup communication
47 #include <native_service/frameworkunified_types.h>
50 #include <asm/unistd.h>
51 #include <stub/com_message_header.h>
54 * \~english Defination of Service name
56 #define LAN_SERVICE_CAN "CAN_COM_PROT"
59 * \~english Availability notification of CAN
61 #define NTFY_Communication_CAN_ISAVAILABLE "Communication/CanIsAvailable"
63 /*********************************************************************
64 * Defining Return Values
65 ***********************************************************************/
70 #define CANIF_RET_NORMAL 1
73 * \~english Parameter error
75 #define CANIF_RET_ERROR_PARAM 2
77 * \~english Buffer Full
79 #define CANIF_RET_ERROR_BUFFULL 3
81 * \~english CAN ID FULL
83 #define CANIF_RET_ERROR_CANIDFULL 4
85 * \~english ID unregister
87 #define CANIF_RET_ERROR_UNDEF 5
89 * \~english Thread ID unmatched
91 #define CANIF_RET_ERROR_PID 6
93 * \~english Timer error
95 #define CANIF_RET_ERROR_TIMER 7
97 * \~english Event Creat Error
99 #define CANIF_RET_ERROR_CREATE_EVENT 8
101 * \~english Error Cancel
103 #define CANIF_RET_ERROR_CANCEL 9
105 * \~english Null Pointer
107 #define CANIF_RET_ERROR_NULL 10
110 * \~english Flags for specifiy Delivery is echoback or not.
112 enum CanIfEchoBackFlags {
114 * \~english Delivery is recv data
118 * \~english Delivery is echo data
124 * \~english Defination of Command ID ( CAN -> user )
126 typedef enum _PS_CommunicationProtocol {
128 * \~english Delivery CAN Data
130 CID_CAN_DATA_DELIVERY = 0x0401,
132 * \~english CAN communication stop
136 * \~english CAN communication restore
138 CID_CAN_COMM_RESTORE,
140 * \~english CAN transmission result
144 * \~english Delivery CAN command
146 CID_CAN_CMD_DELIVERY,
148 * \~english CAN command transmission result
150 CID_CAN_CMD_TX_RESULT,
152 * \~english Delivery CAN data to CANGW
154 CID_CAN_CANGW_DELIVERY,
155 } PS_CommunicationProtocol;
158 * \~english Defination of Command ID ( CANIF -> CAN )
160 typedef enum _PS_Communication_InternalProtocol {
162 * \~english Delivery registration of CAN data
164 CID_CANIF_DELIVERY_ENTRY = 0x0501,
166 * \~english Delivery deregistration of CAN data
168 CID_CANIF_DELIVERY_ERASE,
170 * \~english CAN data transmission start
174 * \~english CAN data communication stop watching
176 CID_CANIF_COMM_WATCH,
178 * \~english CAN command control
182 * \~english CAN data transmission start
184 CID_CANIF_TX_BIT_START,
185 } PS_Communication_InternalProtocol;
187 /*********************************************************************
188 * Definitions of CAN command IDs
189 ***********************************************************************/
191 * \~english Request CAN fuel calculator reset
193 #define CAN_CMDID_FUELCALC_RST_REQ_DELIVERY 0x00
195 * \~english Request CAN startup finished notification
197 #define CAN_CMDID_STARTUP_FIN_REQ_TX 0x01
199 * \~english Request CAN Master reset notification
201 #define CAN_CMDID_MRST_INFO_REQ_TX 0x02
203 * \~english Request CAN version
205 #define CAN_CMDID_VERSION_REQ_TX 0x03
207 * \~english Request CAN connected node notification
209 #define CAN_CMDID_CONNECTION_NODE_REQ_TX 0x04
211 * \~english Request CAN BUS status notification
212 * ToDo@Bus error I/F is not required when CanGetBusStatus() is deleted, so it is scheduled to be deleted.
214 #define CAN_CMDID_BUS_STATUS_REQ_TX 0x05
216 * \~english Response of CAN fuel calculator reset
218 #define CAN_CMDID_FUELCALC_REQ_TX 0x06
220 * \~english Receive CAN fuel calculator reset request
222 #define CAN_CMDID_FUELCALC_RST_REQ_RX 0x07
224 * \~english Receive CAN startup finished notification
226 #define CAN_CMDID_STARTUP_FIN_RESP_RX 0x08
228 * \~english Receive CAN Master reset notification
230 #define CAN_CMDID_MRST_INFO_RESP_RX 0x09
232 * \~english Response of CAN version receive
234 #define CAN_CMDID_VERSION_RESP_RX 0x0A
236 * \~english Response of CAN connection node receive
238 #define CAN_CMDID_CONNECTION_NODE_RESP_RX 0x0B
240 * \~english Response of CAN bus status receive
241 * ToDo@Bus error I/F is not required when CanGetBusStatus() is deleted, so it is scheduled to be deleted.
243 #define CAN_CMDID_BUS_STATUS_RESP_RX 0x0C
245 /*********************************************************************
246 * Control Flag/Status Definition
247 ***********************************************************************/
248 /* CANData Delivery control flag */
250 * \~english Delivery stop
252 #define CAN_DELIVERY_STOP 0
254 * \~english Delivery restart
256 #define CAN_DELIVARY_RESTART 1
258 /* CANData Transmission result notification status */
262 #define CAN_SUCCESS 0
266 #define CAN_RETRYOUT 1
268 * \~english Send buffer full
270 #define CAN_BUFFERFUL 2
272 /* IG linkage type */
274 * \~english IG cooperation off
276 #define CAN_IG_COOPERATION_OFF 0
278 * \~english IG cooperation on
280 #define CAN_IG_COOPERATION_ON 1
284 * \~english Invalid target address
286 #define CAN_NTA_INVALID 0xFF
290 * \~english The code of resource ID which is not used
292 #define CAN_RID_NOTUSE_CODE 0xFF
294 /*********************************************************************
295 * Data size definition
296 ***********************************************************************/
298 * \~english MAX CAN data size used to send/receive message
300 #define CAN_DATA_SIZE 63
302 * \~english MAX CAN data size used to send message
304 #define CAN_TXDATA_SIZE 8
306 /* Data size relationship */
308 * \~english MAX number of delivery entry
309 * \~english ((528-16)-12)/4 = 125 12:event ID etc. , 4:size of CAN ID
311 #define CAN_DELIVERY_CANID_ENTRY_MAX 125
314 * \~english OPC MAX number of delivery entry
316 #define CAN_DELIVERY_OPC_ENTRY_MAX 255
318 /* Message size relationship */
320 * \~english MAX size of message buffer
322 #define CAN_MSGBUF_MAX_SIZE 528
324 * \~english Size of message buffer header
326 #define CAN_MSGBUF_HEADER_SIZE 16
328 * \~english MAX size of message buffer header
330 #define CAN_MSGBUF_DATAMAX_SIZE (CAN_MSGBUF_MAX_SIZE - CAN_MSGBUF_HEADER_SIZE)
333 * \~english MAX size of CAN command data
335 #define CANCMD_DAT_MAX 68
338 * \~english MAX number of CANGW transmission data
340 #define CANGW_SND_NUM_MAX 0x16
342 * \~english MAX length of CANGW DLC
344 #define CANGW_DLC_MAX_SIZE 0x08
346 /*********************************************************************
348 ***********************************************************************/
350 * \~english CAN I/F API return code
352 typedef int32_t CANIF_RET_API;
354 * \~english define of CAN ID type
356 typedef uint32_t CANID;
361 typedef uint32_t DID;
364 * \~english Data struct used to transfer CAN data
365 * \~english (transfer data from CAN to user)
373 * \~english Data Length
381 * \~english DATA[0] ~ DATA[N]
383 uint8_t data[CAN_DATA_SIZE];
388 } CAN_MSG_CANDATA_DAT;
391 * \~english Data struct used to transfer CAN message
392 * \~english (transfer message from CAN to user)
398 T_APIMSG_MSGBUF_HEADER_COMM hdr;
402 CAN_MSG_CANDATA_DAT data;
404 * \~english echoback flag
406 enum CanIfEchoBackFlags echoback;
410 * \~english Data struct used to transfer CAN data to CANGW
411 * \~english (transfer data from CAN to user)
415 * \~english CAN ID (upper byte)
419 * \~english CAN ID (lower byte)
423 * \~english Data Length
429 uint8_t data[CANGW_DLC_MAX_SIZE];
430 } CAN_MSG_CANGWDATA_DAT;
433 * \~english Message struct used to transfer CAN data to CANGW
434 * \~english (transfer message from CAN to user)
440 CAN_MSG_CANGWDATA_DAT data[CANGW_SND_NUM_MAX];
442 * \~english Number of CAN data(max 22)
448 * \~english Data struct used to transfer CAN data
449 * \~english (transfer data from user to CANIF API)
457 * \~english Data Length
467 uint8_t data[CAN_DATA_SIZE + 1];
471 * \~english Data struct used to transfer CAN data
472 * \~english (transfer data from CANIF API to CAN)
476 * \~english Delivery target thread name
478 char notifyName[MAX_NAME_SIZE_APP];
479 // uint32_t notifyId; /* Addresses for delivery ID */
481 * \~english Thread ID used by _CWORD64_
485 * \~english Resource ID
487 uint8_t ucRid; /* Resources ID */
489 * \~english Cycle of send message(Unit of 100ms)
496 } CAN_TRANSMISSION_START_MSG_DAT;
499 * \~english Data struct used to notify transmission result
500 * \~english (transfer data from CAN API to user)
508 * \~english Transmission result status
515 } CAN_MSG_SENDSTS_DAT;
518 * \~english Message struct used to notify transmission result
519 * \~english (transfer message from CAN API to user)
525 T_APIMSG_MSGBUF_HEADER_COMM hdr;
529 CAN_MSG_SENDSTS_DAT data;
533 * \~english Data struct used for regular transmission stop
534 * \~english (transfer data from CANIF API to CAN)
538 * \~english Delivery target thread name
540 char notifyName[MAX_NAME_SIZE_APP];
541 // uint32_t notifyId; /* Addresses for delivery ID */
543 * \~english Event ID that use for _CWORD64_
550 } CAN_FREQ_TRANS_STOP_MSG_DAT;
553 * \~english Data struct used for communication stop/restore
554 * \~english (transfer message from CAN to user)
561 } CAN_MSG_COMM_WATCHSTS_DAT;
564 * \~english Data struct used for communication stop/restore
565 * \~english (transfer message from CAN to user)
571 T_APIMSG_MSGBUF_HEADER_COMM hdr;
575 CAN_MSG_COMM_WATCHSTS_DAT data;
576 } CAN_MSG_COMM_WATCHSTS;
579 * \~english Data struct used for delivery entry
580 * \~english (transfer data from CANIF API to CAN)
584 * \~english Delivery target thread name
586 char notifyName[MAX_NAME_SIZE_APP];
587 // uint32_t notifyId; /* Addresses for delivery ID */
589 * \~english Event ID use for _CWORD64_
593 * \~english Number of CAN ID entry
597 * \~english CAN ID entry array
599 CANID ulCanid[CAN_DELIVERY_CANID_ENTRY_MAX];
600 } CAN_DELIVERY_ENTRY;
603 * \~english Data struct used for communication stop
604 * \~english (transfer data from CANIF API to CAN)
608 * \~english Delivery target thread name
610 char notifyName[MAX_NAME_SIZE_APP]; /* Destination thread name */
624 * \~english Watch time for commuication stop (Unit of 100ms)
626 uint16_t usWatchTime;
627 } CAN_COMM_WATCH_MSG_DAT;
630 * \~english Data struct used for CAN command control
631 * \~english (transfer data from CANIF API to CAN)
635 * \~english Delivery target thread name
637 char notifyName[MAX_NAME_SIZE_APP];
638 // uint32_t notifyId; /* Transfer to: ID */
644 * \~english Resource ID
648 * \~english CAN command ID
651 } CAN_CMD_CTRL_MSG_DAT;
654 * \~english Data struct used for CAN command delivery
655 * \~english (transfer data from CAN to user)
659 * \~english CAN command ID
669 uint8_t data[CANCMD_DAT_MAX];
670 } CAN_MSG_CANCMD_DAT;
673 * \~english Message struct used for CAN command delivery
674 * \~english (transfer message from CAN to user)
680 T_APIMSG_MSGBUF_HEADER_COMM hdr;
684 CAN_MSG_CANCMD_DAT data;
688 * \~english Data struct used for CAN command transmission result
689 * \~english (transfer data from CAN to user)
693 * \~english CAN command ID(same as delivery format)
697 * \~english Delivery result status
704 } CAN_CMD_MSG_SENDSTS_DAT;
707 * \~english Data struct used for CAN command transmission result
708 * \~english (transfer data from CAN to user)
714 T_APIMSG_MSGBUF_HEADER_COMM hdr;
718 CAN_CMD_MSG_SENDSTS_DAT data;
719 } CAN_CMD_MSG_SENDSTS;
722 * \~english Data struct for receiving message(work data)
728 T_APIMSG_MSGBUF_HEADER_COMM stHead;
732 uint8_t ucData[CAN_MSGBUF_DATAMAX_SIZE];
736 * \~english CAN data struct of communication stop registration
737 * \~english (transfer data from CANIF API to CAN)
741 * \~english Delivery target thread name
743 char notifyName[MAX_NAME_SIZE_APP];
745 * \~english Event ID for _CWORD64_
757 * \~english Watch time for communication stop(Unit of 100ms)
759 uint16_t usWatchTime;
761 * \~english has IG coopration or not
764 } CAN_COMM_WATCHEXT_MSG_DAT;
767 * \~english Mask data struct for CAN data
771 * \~english Mask data
773 uint8_t dat[CAN_TXDATA_SIZE];
777 * \~english Data struct used for CAN data transmission
781 * \~english Transmission data
783 uint8_t dat[CAN_TXDATA_SIZE];
787 * \~english Data struct used for CAN data transmission registration
795 * \~english Mask data
799 * \~english Transmission data
803 * \~english Cycle of regular transmission
806 } CAN_TRANS_START_MSG_DAT;
808 /***********************************************************************
809 * CANIF API Functions Prototypes *
810 ************************************************************************/
811 #if defined(__cplusplus)
815 /*******************************************************************************
816 * MODULE : Canif_DeliveryEntry
817 ******************************************************************************/
818 ////////////////////////////////////////////////////////////////////////////////
819 /// \ingroup Canif_DeliveryEntry
820 /// \~english @par Brief
821 /// Delivery registration of CAN data
822 /// \~english @param [in] h_app
823 /// HANDLE - Handle for application
824 /// \~english @param [in] notify_name
825 /// PCSTR - Delivery target thread name
826 /// \~english @param [in] can_num
827 /// uint8_t - Number of delivery registration CAN ID
828 /// \~english @param [in] p_can_id
829 /// CANID* - Pointer of delivery registration CAN ID array
830 /// \~english @retval CANIF_RET_NORMAL Normality
831 /// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter
832 /// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination
833 /// \~english @par Prerequisite
835 /// \~english @par Change of internal state
836 /// - Change of internal state according to the API does not occur
837 /// \~english @par Conditions of processing failure
838 /// - h_app is NULL.[CANIF_RET_ERROR_PARAM]
839 /// -notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes.
840 /// [CANIF_RET_ERROR_PARAM]
841 /// - can_num is 0 or bigger than 125.[CANIF_RET_ERROR_PARAM]
842 /// - CAN ID pointer is null.[CANIF_RET_ERROR_PARAM]
843 /// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM]
844 /// - malloc failed to get the message queue management information area
845 /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL]
846 /// - malloc failed to get the message queue name storage area for
847 /// transmission to communication service. [CANIF_RET_ERROR_CANCEL]
848 /// - mq_open failed to open the message queue for transmission
849 /// to communication service. [CANIF_RET_ERROR_CANCEL]
850 /// - The session message queue to communication service is full.
851 /// [CANIF_RET_ERROR_CANCEL]
852 /// - The transmission file descriptor of the session
853 /// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL]
854 /// - The interruption by the system call (signal) occurred while
855 /// transmitting the session message to communication service.
856 /// [CANIF_RET_ERROR_CANCEL]
857 /// - Any error occurred in the transmission of the session message
858 /// to communication service. [CANIF_RET_ERROR_CANCEL]
859 /// - It failed to access to the shared memory for the transmission of
860 /// session message to communication service. [CANIF_RET_ERROR_CANCEL]
861 /// \~english @par Classification
863 /// \~english @par Type
865 /// \~english @par Detail
866 /// - Delivery registration of CAN data. \n
867 /// \~english @see None
868 ////////////////////////////////////////////////////////////////////////////////
869 CANIF_RET_API Canif_DeliveryEntry(HANDLE h_app, PCSTR notify_name,
870 uint8_t can_num, CANID *p_can_id);
872 /*******************************************************************************
873 * MODULE : Canif_TransmissionStart
874 ******************************************************************************/
875 ////////////////////////////////////////////////////////////////////////////////
876 /// \ingroup Canif_TransmissionStart
877 /// \~english @par Brief
878 /// CAN data transmission starting
879 /// \~english @param [in] h_app
880 /// HANDLE - Handle for application
881 /// \~english @param [in] notify_name
882 /// PCSTR - Delivery target thread name
883 /// \~english @param [in] rid
884 /// uint8_t - Resource ID for CAN data transmission result notification
885 /// \~english @param [in] freq
886 /// uint16_t - Cycle of regular transmission
887 /// \~english @param [in] p_data
888 /// CAN_DATA* - Pointer of transmission data
889 /// \~english @retval CANIF_RET_NORMAL Normality
890 /// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter
891 /// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination
892 /// \~english @par Prerequisite
894 /// \~english @par Change of internal state
895 /// - Change of internal state according to the API does not occur
896 /// \~english @par Conditions of processing failure
897 /// - h_app is NULL.[CANIF_RET_ERROR_PARAM]
898 /// -notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes.
899 /// [CANIF_RET_ERROR_PARAM]
900 /// - Transmission data pointer is null.[CANIF_RET_ERROR_PARAM]
901 /// - DLC size is bigger than 8 bytes.[CANIF_RET_ERROR_PARAM]
902 /// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM]
903 /// - CAN ID is not defined in the _CWORD108_ bit asignment table
904 /// [CANIF_RET_ERROR_PARAM]
905 /// - malloc failed to get the message queue management information area
906 /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL]
907 /// - malloc failed to get the message queue name storage area for
908 /// transmission to communication service. [CANIF_RET_ERROR_CANCEL]
909 /// - mq_open failed to open the message queue for transmission
910 /// to communication service. [CANIF_RET_ERROR_CANCEL]
911 /// - The session message queue to communication service is full.
912 /// [CANIF_RET_ERROR_CANCEL]
913 /// - The transmission file descriptor of the session
914 /// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL]
915 /// - The interruption by the system call (signal) occurred while
916 /// transmitting the session message to communication service.
917 /// [CANIF_RET_ERROR_CANCEL]
918 /// - Any error occurred in the transmission of the session message
919 /// to communication service. [CANIF_RET_ERROR_CANCEL]
920 /// - It failed to access to the shared memory for the transmission of
921 /// session message to communication service. [CANIF_RET_ERROR_CANCEL]
922 /// \~english @par Classification
924 /// \~english @par Type
926 /// \~english @par Detail
927 /// - The transmission of the CAN data starts(Regular/One). \n
928 /// \~english @see None
929 ////////////////////////////////////////////////////////////////////////////////
930 CANIF_RET_API Canif_TransmissionStart(HANDLE h_app, PCSTR notify_name,
931 uint8_t rid, uint16_t freq, CAN_DATA *p_data);
933 /*******************************************************************************
934 * MODULE : Canif_CommandCtrl
935 ******************************************************************************/
936 ////////////////////////////////////////////////////////////////////////////////
937 /// \ingroup Canif_CommandCtrl
938 /// \~english @par Brief
939 /// CAN command control
940 /// \~english @param [in] h_app
941 /// HANDLE - Handle for application
942 /// \~english @param [in] notify_name
943 /// PCSTR - Delivery target thread name
944 /// \~english @param [in] rid
945 /// uint8_t - Resource ID
946 /// \~english @param [in] cmd_id
947 /// uint32_t - CAN command ID(32bit)
948 /// \~english @retval CANIF_RET_NORMAL Normality
949 /// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter
950 /// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination
951 /// \~english @par Prerequisite
953 /// \~english @par Change of internal state
954 /// - Change of internal state according to the API does not occur
955 /// \~english @par Conditions of processing failure
956 /// - h_app is NULL.[CANIF_RET_ERROR_PARAM]
957 /// -notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes.
958 /// [CANIF_RET_ERROR_PARAM]
959 /// - CAN command ID is invalid.[CANIF_RET_ERROR_PARAM]
960 /// - malloc failed to get the message queue management information area
961 /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL]
962 /// - malloc failed to get the message queue name storage area for
963 /// transmission to communication service. [CANIF_RET_ERROR_CANCEL]
964 /// - mq_open failed to open the message queue for transmission
965 /// to communication service. [CANIF_RET_ERROR_CANCEL]
966 /// - The session message queue to communication service is full.
967 /// [CANIF_RET_ERROR_CANCEL]
968 /// - The transmission file descriptor of the session
969 /// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL]
970 /// - The interruption by the system call (signal) occurred while
971 /// transmitting the session message to communication service.
972 /// [CANIF_RET_ERROR_CANCEL]
973 /// - Any error occurred in the transmission of the session message
974 /// to communication service. [CANIF_RET_ERROR_CANCEL]
975 /// - It failed to access to the shared memory for the transmission of
976 /// session message to communication service. [CANIF_RET_ERROR_CANCEL]
977 /// \~english @par Classification
979 /// \~english @par Type
981 /// \~english @par Detail
982 /// - Transmission control of CAN command. \n
983 /// \~english @see None
984 ////////////////////////////////////////////////////////////////////////////////
985 CANIF_RET_API Canif_CommandCtrl(HANDLE h_app, PCSTR notify_name, uint8_t rid,
988 /*******************************************************************************
989 * MODULE : Canif_CommWatch
990 ******************************************************************************/
991 ////////////////////////////////////////////////////////////////////////////////
992 /// \ingroup Canif_CommWatch
993 /// \~english @par Brief
994 /// CAN data regular transmission stop
995 /// \~english @param [in] h_app
996 /// HANDLE - Handle for application
997 /// \~english @param [in] notify_name
998 /// PCSTR - Delivery target thread name
999 /// \~english @param [in] can_id
1001 /// \~english @param [in] did
1003 /// \~english @param [in] watch_time
1004 /// uint16_t - Communication watch suspension time(Unit of 100ms)
1005 /// \~english @retval CANIF_RET_NORMAL Normality
1006 /// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter
1007 /// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination
1008 /// \~english @par Prerequisite
1010 /// \~english @par Change of internal state
1011 /// - Change of internal state according to the API does not occur
1012 /// \~english @par Conditions of processing failure
1013 /// - h_app is NULL.[CANIF_RET_ERROR_PARAM]
1014 /// -notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes.
1015 /// [CANIF_RET_ERROR_PARAM]
1016 /// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM]
1017 /// - malloc failed to get the message queue management information area
1018 /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL]
1019 /// - malloc failed to get the message queue name storage area for
1020 /// transmission to communication service. [CANIF_RET_ERROR_CANCEL]
1021 /// - mq_open failed to open the message queue for transmission
1022 /// to communication service. [CANIF_RET_ERROR_CANCEL]
1023 /// - The session message queue to communication service is full.
1024 /// [CANIF_RET_ERROR_CANCEL]
1025 /// - The transmission file descriptor of the session
1026 /// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL]
1027 /// - The interruption by the system call (signal) occurred while
1028 /// transmitting the session message to communication service.
1029 /// [CANIF_RET_ERROR_CANCEL]
1030 /// - Any error occurred in the transmission of the session message
1031 /// to communication service. [CANIF_RET_ERROR_CANCEL]
1032 /// - It failed to access to the shared memory for the transmission of
1033 /// session message to communication service. [CANIF_RET_ERROR_CANCEL]
1034 /// \~english @par Classification
1036 /// \~english @par Type
1038 /// \~english @par Detail
1039 /// - CAN data regular transmission stop. \n
1040 /// \~english @see None
1041 ////////////////////////////////////////////////////////////////////////////////
1042 CANIF_RET_API Canif_CommWatch(HANDLE h_app, PCSTR notify_name, CANID can_id,
1043 DID did, uint16_t watch_time);
1045 ////////////////////////////////////////////////////////////////////////////////
1046 /// \ingroup Canif_TransStart
1047 /// \~english @par Brief
1048 /// Transmission CAN Command
1049 /// \~english @param [in] h_app
1050 /// HANDLE - Handle for application
1051 /// \~english @param [in] can_id
1053 /// \~english @param [in] mask
1054 /// CAN_DATA_MASK* - Mask Data
1055 /// \~english @param [in] dat
1056 /// CAN_DATA_BIT* - Transmission Data
1057 /// \~english @param [in] freq
1058 /// uint32_t - Transmission Cycle
1059 /// \~english @retval CANIF_RET_NORMAL Normality
1060 /// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter
1061 /// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination
1062 /// \~english @par Prerequisite
1064 /// \~english @par Change of internal state
1065 /// - Change of internal state according to the API does not occur
1066 /// \~english @par Conditions of processing failure
1067 /// - h_app is NULL.[CANIF_RET_ERROR_PARAM]
1068 /// - Transmission Cycle is bigger than 0xFFFF.[CANIF_RET_ERROR_PARAM]
1069 /// - CAN ID is NULL.[CANIF_RET_ERROR_PARAM]
1070 /// - Mask Data is NULL.[CANIF_RET_ERROR_PARAM]
1071 /// - Transmission Data is NULL.[CANIF_RET_ERROR_PARAM]
1072 /// - CAN ID is not defined in the _CWORD108_ bit asignment table
1073 /// [CANIF_RET_ERROR_PARAM]
1074 /// - The upper 3bits of CAN ID are not 0.[CANIF_RET_ERROR_PARAM]
1075 /// - malloc failed to get the message queue management information area
1076 /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL]
1077 /// - malloc failed to get the message queue name storage area for
1078 /// transmission to communication service. [CANIF_RET_ERROR_CANCEL]
1079 /// - mq_open failed to open the message queue for transmission
1080 /// to communication service. [CANIF_RET_ERROR_CANCEL]
1081 /// - The session message queue to communication service is full.
1082 /// [CANIF_RET_ERROR_CANCEL]
1083 /// - The transmission file descriptor of the session
1084 /// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL]
1085 /// - The interruption by the system call (signal) occurred while
1086 /// transmitting the session message to communication service.
1087 /// [CANIF_RET_ERROR_CANCEL]
1088 /// - Any error occurred in the transmission of the session message
1089 /// to communication service. [CANIF_RET_ERROR_CANCEL]
1090 /// - It failed to access to the shared memory for the transmission of
1091 /// session message to communication service. [CANIF_RET_ERROR_CANCEL]
1092 /// \~english @par Classification
1094 /// \~english @par Type
1096 /// \~english @par Detail
1097 /// - Start Transmission CAN Command API. \n
1098 /// \~english @see None
1099 ////////////////////////////////////////////////////////////////////////////////
1100 CANIF_RET_API Canif_TransStart(HANDLE h_app, CANID can_id, CAN_DATA_MASK *mask,
1101 CAN_DATA_BIT *dat, uint32_t freq);
1103 ////////////////////////////////////////////////////////////////////////////////
1104 /// \ingroup Canif_DeliveryEraseAll
1105 /// \~english @par Brief
1106 /// Delete all delivery entry
1107 /// \~english @param [in] h_app
1108 /// HANDLE - Handle for application
1109 /// \~english @param [in] notify_name
1110 /// PCSTR - Delivery target thread name
1111 /// \~english @retval CANIF_RET_NORMAL Normality
1112 /// \~english @retval CANIF_RET_ERROR_PARAM Abnormality of parameter
1113 /// \~english @retval CANIF_RET_ERROR_CANCEL Abnormal termination
1114 /// \~english @par Prerequisite
1116 /// \~english @par Change of internal state
1117 /// - Change of internal state according to the API does not occur
1118 /// \~english @par Conditions of processing failure
1119 /// - h_app is NULL.[CANIF_RET_ERROR_PARAM]
1120 /// -notify_nameis NULL or the length ofnotify_nameis longer than 15 bytes.
1121 /// [CANIF_RET_ERROR_PARAM]
1122 /// - malloc failed to get the message queue management information area
1123 /// for transmission to communication service. [CANIF_RET_ERROR_CANCEL]
1124 /// - malloc failed to get the message queue name storage area for
1125 /// transmission to communication service. [CANIF_RET_ERROR_CANCEL]
1126 /// - mq_open failed to open the message queue for transmission
1127 /// to communication service. [CANIF_RET_ERROR_CANCEL]
1128 /// - The session message queue to communication service is full.
1129 /// [CANIF_RET_ERROR_CANCEL]
1130 /// - The transmission file descriptor of the session
1131 /// message to communication service is invalid. [CANIF_RET_ERROR_CANCEL]
1132 /// - The interruption by the system call (signal) occurred while
1133 /// transmitting the session message to communication service.
1134 /// [CANIF_RET_ERROR_CANCEL]
1135 /// - Any error occurred in the transmission of the session message
1136 /// to communication service. [CANIF_RET_ERROR_CANCEL]
1137 /// - It failed to access to the shared memory for the transmission of
1138 /// session message to communication service. [CANIF_RET_ERROR_CANCEL]
1139 /// \~english @par Classification
1141 /// \~english @par Type
1143 /// \~english @par Detail
1144 /// - Delete all delivery entry. \n
1145 /// \~english @see None
1146 ////////////////////////////////////////////////////////////////////////////////
1147 CANIF_RET_API Canif_DeliveryEraseAll(HANDLE h_app, PCSTR notify_name);
1149 /** @}*/ // end of CAN
1150 /** @}*/ // end of communication
1151 /** @}*/ // end of peripheral_service
1152 /** @}*/ // end of BaseSystem
1154 #if defined(__cplusplus)
1158 #endif // COMMUNICATION_CLIENT_CAN_INCLUDE_PERIPHERAL_SERVICE_CANIF_API_H_