Init basesystem source codes.
[staging/basesystem.git] / vehicleservice / positioning / server / include / ServiceInterface / VehicleIf.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 POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_VEHICLEIF_H_
18 #define POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_VEHICLEIF_H_
19
20 /*---------------------------------------------------------------------------------*
21  * Incluce                                                                         *
22  *---------------------------------------------------------------------------------*/
23 #include <native_service/frameworkunified_types.h>
24 #include <native_service/frameworkunified_framework_if.h>
25
26 #include <vehicle_service/positioning_base_library.h>
27 #include <stub/vehicle_notifications.h>
28 #include <stub/Vehicle_Sensor_Common_API.h>
29
30 /*---------------------------------------------------------------------------------*
31  * Definition                                                                      *
32  *---------------------------------------------------------------------------------*/
33 /* Transmission Type */
34 #define VEHICLEIF_TRANSMISSION_TYPE_MT         0
35 #define VEHICLEIF_TRANSMISSION_TYPE_AT         1
36 #define VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN    2
37 #define VEHICLEIF_TRANSMISSION_TYPE_NUM        3 /* Number of Transmission Types */
38
39 /* Shift Position (CAUTION: These values depend on Vehicle I/F) */
40 #define VEHICLEIF_SHIFT_POSITION_U             0
41 #define VEHICLEIF_SHIFT_POSITION_R             1
42 #define VEHICLEIF_SHIFT_POSITION_P             2
43 #define VEHICLEIF_SHIFT_POSITION_N             4
44 #define VEHICLEIF_SHIFT_POSITION_D             8
45 #define VEHICLEIF_SHIFT_POSITION_NUM           5 /* Number of Shift Position Types */
46
47 /* Parking Brake (CAUTION: These values depend on Vehicle I/F) */
48 #define VEHICLEIF_PKB_OFF             0
49 #define VEHICLEIF_PKB_ON              1
50 #define VEHICLEIF_PKB_UNKNOWN         2
51 #define VEHICLEIF_PKB_NUM             3
52
53 /*---------------------------------------------------------------------------------*
54  * Typedef declaration                                                             *
55  *---------------------------------------------------------------------------------*/
56
57 /*---------------------------------------------------------------------------------*
58  * Struct declaration                                                              *
59  *---------------------------------------------------------------------------------*/
60
61 /*---------------------------------------------------------------------------------*
62  * Prototype Declaration                                                           *
63  *---------------------------------------------------------------------------------*/
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 void VehicleIf_SetAvailability(BOOL bIsAvailable);
68
69 //EFrameworkunifiedStatus VehicleIf_GetTypeOfTransmission(uint8_t* pType, BOOL* pbIsAvailable);
70 EFrameworkunifiedStatus VehicleIf_GetTypeOfTransmission(uint8_t* pType, uint8_t* pPkb, BOOL* pbIsAvailable);
71 EFrameworkunifiedStatus VehicleIf_GetShiftPosition(uint8_t* pShift, BOOL* pbIsAvailable);
72 EFrameworkunifiedStatus VehicleIfAttachCallbacksToDispatcher(    // NOLINT(readability/nolint)
73                                                 _FrameworkunifiedProtocolCallbackHandler const* p_msg_handler,
74                                                 unsigned int ui_handlercount);
75 EFrameworkunifiedStatus VehicleIfDetachCallbacksFromDispatcher(const PUI_32 pui_cmd_array, UI_32 ui_command_count);
76 EFrameworkunifiedStatus VehicleIfNotifyOnVehicleAvailability(CbFuncPtr fp_on_cmd);
77 EFrameworkunifiedStatus VehicleIfDeliveryEntry(uint32_t ul_did);
78 #ifdef __cplusplus
79 }
80 #endif
81
82 #endif  // POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_VEHICLEIF_H_