1 /*
2  * Copyright (C) 2021 The Android Open Source Project
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 android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_
18 #define android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_
19 
20 #include <VehicleHalTypes.h>
21 #include <android/hardware/automotive/vehicle/SubscribeOptions.pb.h>
22 #include <android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h>
23 #include <android/hardware/automotive/vehicle/VehiclePropConfig.pb.h>
24 #include <android/hardware/automotive/vehicle/VehiclePropValue.pb.h>
25 #include <android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.h>
26 #include <android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.h>
27 #include <android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.h>
28 
29 namespace android {
30 namespace hardware {
31 namespace automotive {
32 namespace vehicle {
33 namespace proto_msg_converter {
34 
35 // Convert AIDL VehiclePropConfig to Protobuf VehiclePropConfig.
36 void aidlToProto(
37         const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& inAidlConfig,
38         ::android::hardware::automotive::vehicle::proto::VehiclePropConfig* outProtoConfig);
39 // Convert Protobuf VehiclePropConfig to AIDL VehiclePropConfig.
40 void protoToAidl(
41         const ::android::hardware::automotive::vehicle::proto::VehiclePropConfig& inProtoConfig,
42         ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* outAidlConfig);
43 // Convert AIDL VehiclePropValue to Protobuf VehiclePropValue.
44 void aidlToProto(const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& inAidlVal,
45                  ::android::hardware::automotive::vehicle::proto::VehiclePropValue* outProtoVal);
46 // Convert Protobuf VehiclePropValue to AIDL VehiclePropValue.
47 void protoToAidl(
48         const ::android::hardware::automotive::vehicle::proto::VehiclePropValue& inProtoVal,
49         ::aidl::android::hardware::automotive::vehicle::VehiclePropValue* outAidlVal);
50 // Convert AIDL SubscribeOptions to Protobuf SubscribeOptions.
51 void aidlToProto(const ::aidl::android::hardware::automotive::vehicle::SubscribeOptions& in,
52                  ::android::hardware::automotive::vehicle::proto::SubscribeOptions* out);
53 // Convert Protobuf SubscribeOptions to AIDL SubscribeOptions.
54 void protoToAidl(const ::android::hardware::automotive::vehicle::proto::SubscribeOptions& in,
55                  ::aidl::android::hardware::automotive::vehicle::SubscribeOptions* out);
56 
57 }  // namespace proto_msg_converter
58 }  // namespace vehicle
59 }  // namespace automotive
60 }  // namespace hardware
61 }  // namespace android
62 
63 #endif  // android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_
64