blob: 57eafd3d7cdb8a2e688fc0b8a0e8afa43794206e [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_TUNER_H
17#define ANDROID_HARDWARE_BROADCASTRADIO_V1_1_TUNER_H
18
19#include <android/hardware/broadcastradio/1.1/ITuner.h>
20#include <android/hardware/broadcastradio/1.1/ITunerCallback.h>
21
22namespace android {
23namespace hardware {
24namespace broadcastradio {
25namespace V1_1 {
26namespace implementation {
27
28using V1_0::Direction;
29
30struct BroadcastRadio;
31
32struct Tuner : public ITuner {
33
34 Tuner(const sp<V1_0::ITunerCallback>& callback, const wp<BroadcastRadio>& mParentDevice);
35
36 // Methods from ::android::hardware::broadcastradio::V1_1::ITuner follow.
37 Return<Result> setConfiguration(const BandConfig& config) override;
38 Return<void> getConfiguration(getConfiguration_cb _hidl_cb) override;
39 Return<Result> scan(Direction direction, bool skipSubChannel) override;
40 Return<Result> step(Direction direction, bool skipSubChannel) override;
41 Return<Result> tune(uint32_t channel, uint32_t subChannel) override;
42 Return<Result> cancel() override;
43 Return<void> getProgramInformation(getProgramInformation_cb _hidl_cb) override;
44 Return<void> getProgramInformation_1_1(getProgramInformation_1_1_cb _hidl_cb) override;
Tomasz Wasilczyk803301a2017-03-13 14:30:15 -070045 Return<ProgramListResult> startBackgroundScan() override;
Tomasz Wasilczyk2dd1d8d2017-03-01 14:21:07 -080046 Return<void> getProgramList(const hidl_string& filter, getProgramList_cb _hidl_cb) override;
Tomasz Wasilczykc7002822017-03-27 14:29:16 -070047 Return<void> isAnalogForced(isAnalogForced_cb _hidl_cb) override;
48 Return<Result> setAnalogForced(bool isForced) override;
Tomasz Wasilczyk213170b2017-02-07 17:38:21 -080049
50 static void callback(radio_hal_event_t *halEvent, void *cookie);
51 void onCallback(radio_hal_event_t *halEvent);
52
53 void setHalTuner(const struct radio_tuner *halTuner) { mHalTuner = halTuner; }
54 const struct radio_tuner *getHalTuner() { return mHalTuner; }
55
56private:
57 ~Tuner();
58
59 const struct radio_tuner *mHalTuner;
60 const sp<V1_0::ITunerCallback> mCallback;
61 const sp<V1_1::ITunerCallback> mCallback1_1;
62 const wp<BroadcastRadio> mParentDevice;
63};
64
65
66} // namespace implementation
67} // namespace V1_1
68} // namespace broadcastradio
69} // namespace hardware
70} // namespace android
71
72#endif // ANDROID_HARDWARE_BROADCASTRADIO_V1_1_TUNER_H