01f2e2ff29d706d8ba9ffeaf4b5cb15d1530255d
[staging/basesystem.git] / video_in_hal / peripheralservice / communication / server / include / CAN / Delivery / CAN_Delivery.h
1 /*
2  * @copyright Copyright (c) 2016-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_SERVER_INCLUDE_CAN_DELIVERY_CAN_DELIVERY_H_
18 #define COMMUNICATION_SERVER_INCLUDE_CAN_DELIVERY_CAN_DELIVERY_H_
19 #include <native_service/frameworkunified_types.h>
20 #include "CAN_Thread.h"
21 #include <vector>
22 #include <map>
23 #include <string>
24 #include <can_hal.h>
25
26 typedef std::multimap<CANID, std::string> CAN_DeliveryEntryList;
27 typedef CAN_DeliveryEntryList::iterator CAN_DeliveryEntryListIt;
28 typedef std::pair<const CANID, std::string> CAN_DeliveryEntryListPair;
29
30 void CANDeliveryInit(void);
31 bool CANDeliveryInsert(CANID canid, std::string s);
32 EFrameworkunifiedStatus CANDeliveryRcvProcess(HANDLE h_app, CanMessage *msg);
33 EFrameworkunifiedStatus CANDeliveryEntry(HANDLE h_app);
34 EFrameworkunifiedStatus CANClearEntry(HANDLE h_app);
35 EFrameworkunifiedStatus CANDeliverySndMsg(HANDLE h_app, CANID ul_canid, uint8_t n_ta,
36   uint8_t uc_dlc, const uint8_t *puc_data,
37   PS_CommunicationProtocol cid, enum CanIfEchoBackFlags flag = CANIF_PURERECV);
38 EFrameworkunifiedStatus CANCommandDeliveryRcvProcess(HANDLE h_app,
39                                                  CanMessage *msg, uint8_t cmd);
40 #endif  // COMMUNICATION_SERVER_INCLUDE_CAN_DELIVERY_CAN_DELIVERY_H_