• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 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_V2_0_impl_virtialization_GrpcVehicleServer_H_
18 #define android_hardware_automotive_vehicle_V2_0_impl_virtialization_GrpcVehicleServer_H_
19 
20 #include "Utils.h"
21 #include "vhal_v2_0/VehicleHalServer.h"
22 
23 namespace android {
24 namespace hardware {
25 namespace automotive {
26 namespace vehicle {
27 namespace V2_0 {
28 
29 namespace impl {
30 
31 // Connect to the Vehicle Client via GRPC
32 class GrpcVehicleServer : public VehicleHalServer {
33   public:
34     // Start listening incoming calls
35     virtual GrpcVehicleServer& Start() = 0;
36 
37     // Wait until error or Stop is called
38     virtual void Wait() = 0;
39 
40     // Stop the server
41     virtual GrpcVehicleServer& Stop() = 0;
42 
43     // Methods for unit tests
44     virtual uint32_t NumOfActivePropertyValueStream() = 0;
45 };
46 
47 using GrpcVehicleServerPtr = std::unique_ptr<GrpcVehicleServer>;
48 
49 GrpcVehicleServerPtr makeGrpcVehicleServer(const VirtualizedVhalServerInfo& serverInfo);
50 
51 }  // namespace impl
52 
53 }  // namespace V2_0
54 }  // namespace vehicle
55 }  // namespace automotive
56 }  // namespace hardware
57 }  // namespace android
58 
59 #endif  // android_hardware_automotive_vehicle_V2_0_impl_virtialization_GrpcVehicleServer_H_
60