Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / peripheralservice / communication / client_can / include / Canif_TransmissionData.h
1 /*
2  * @copyright Copyright (c) 2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_TRANSMISSIONDATA_H_
18 #define COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_TRANSMISSIONDATA_H_
19
20 #define LAN_TYPE_21PF             "CAN_21PF"
21
22 typedef struct {
23   uint8_t dlc;
24   CAN_DATA_BIT dat;
25 } CAN_TRANS_START_TABLE_VAL;
26
27 typedef struct {
28   CANID  canid;
29   CAN_TRANS_START_TABLE_VAL  val;
30 } CAN_INIT_TABLE;
31
32 #include "Canif_TransmissionData21PF.h"
33
34 static inline bool Canif_InitDataIsDefined21PF(CANID id) {
35   int32_t count;
36   int i;
37
38   count = sizeof(Can_TransInitData_21PF) /
39           sizeof(Can_TransInitData_21PF[0]);
40   for (i = 0; i < count; i++) {
41     if (id == Can_TransInitData_21PF[i].canid)
42       return true;
43   }
44
45   return false;
46 }
47
48 #endif  // COMMUNICATION_CLIENT_CAN_INCLUDE_CANIF_TRANSMISSIONDATA_H_