blob: 22902ba513c6fdefae6d99f93bab716929972c7c [file] [log] [blame]
Tomasz Wasilczyk213170b2017-02-07 17:38:21 -08001/*
2 * Copyright (C) 2017 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#ifndef ANDROID_HARDWARE_BROADCASTRADIO_V1_1_UTILS_H
17#define ANDROID_HARDWARE_BROADCASTRADIO_V1_1_UTILS_H
18
19#include <android/hardware/broadcastradio/1.1/types.h>
20#include <hardware/radio.h>
21
22namespace android {
23namespace hardware {
24namespace broadcastradio {
25namespace V1_1 {
26namespace implementation {
27
28using V1_0::Class;
29using V1_0::BandConfig;
30using V1_0::MetaData;
31using V1_0::Properties;
32
33class Utils {
34public:
35 static const char * getClassString(Class ClassId);
36 static Result convertHalResult(int rc);
37 static void convertBandConfigFromHal(BandConfig *config,
38 const radio_hal_band_config_t *halConfig);
39 static void convertPropertiesFromHal(Properties *properties,
40 const radio_hal_properties_t *halProperties);
41 static void convertBandConfigToHal(radio_hal_band_config_t *halConfig,
42 const BandConfig *config);
43 static void convertProgramInfoFromHal(ProgramInfo *info,
44 radio_program_info_t *halInfo);
45 static int convertMetaDataFromHal(hidl_vec<MetaData>& metadata,
46 radio_metadata_t *halMetadata);
47private:
48 static const char * sClassModuleNames[];
49
50};
51
52} // namespace implementation
53} // namespace V1_1
54} // namespace broadcastradio
55} // namespace hardware
56} // namespace android
57
58#endif // ANDROID_HARDWARE_BROADCASTRADIO_V1_1_UTILS_H