2 * Copyright 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package android.hardware.broadcastradio@1.0;
19 enum Result : int32_t {
28 * Radio hardware module class. A given radio hardware module HAL is of one
29 * class only. The platform can not have more than one hardware module of
30 * each class. Current version of the framework only supports RADIO_CLASS_AM_FM.
32 enum Class : uint32_t {
33 /** FM (including HD radio) and AM */
35 /** Satellite Radio */
37 /** Digital Radio (DAB) */
41 /** value for field "type" of radio band described in struct radio_hal_band_config */
42 enum Band : uint32_t {
43 /** Amplitude Modulation band: LW, MW, SW */
45 /** Frequency Modulation band: FM */
47 /** FM HD Radio / DRM (IBOC) */
49 /** AM HD Radio / DRM (IBOC) */
53 /** RDS variant implemented. A struct FmBandConfig can list none or several. */
61 /* FM deemphasis variant implemented.
62 * A struct FmBandConfig can list one or more. */
63 enum Deemphasis : uint32_t {
68 /** Scanning direction for scan() and step() tuner APIs */
69 enum Direction : uint32_t {
74 /** Unique handle allocated to a radio module */
75 typedef uint32_t Handle;
78 /** Additional attributes for an FM band configuration */
80 /** deemphasis variant */
81 Deemphasis deemphasis;
82 /** stereo supported */
84 /** RDS variants supported */
86 /** Traffic Announcement supported */
88 /** Alternate Frequency supported */
90 /** Emergency announcements supported */
94 /** Additional attributes for an AM band configuration */
96 /** Stereo supported */
100 /* Radio band configuration. Describes a given band supported by the radio
101 * module. The HAL can expose only one band per type with the the maximum range
102 * supported and all options. The framework will derive the actual regions were
103 * this module can operate and expose separate band configurations for
104 * applications to chose from. */
107 bool antennaConnected;
110 vec<uint32_t> spacings;
117 /* Exposes properties of a given hardware radio module.
118 * NOTE: current framework implementation supports only one audio source
119 * (num_audio_sources = 1). The source corresponds to AUDIO_DEVICE_IN_FM_TUNER.
120 * If more than one tuner is supported (num_tuners > 1), only one can be
121 * connected to the audio source. */
123 /** Class of this module. E.g AM_FM */
125 /** implementor name */
129 /** product version */
131 /** serial number (for subscription services) */
133 /** number of tuners controllable independently */
135 /** number of audio sources driven simultaneously */
136 uint32_t numAudioSources;
137 /** the hardware supports capture of audio source from audio HAL */
138 bool supportsCapture;
139 vec<BandConfig> bands; /** band descriptors */
142 enum MetadataType : int32_t {
144 /** Signed 32 bit integer */
149 * Raw binary data (icon or art).
151 * The data should be a valid PNG, JPEG, GIF or BMP file.
152 * Invalid format must be handled gracefully as if the field was missing.
155 /** clock data, see MetaDataClock */
159 enum MetadataKey : int32_t {
161 /** RDS PI - int32_t */
163 /** RDS PS - string */
165 /** RDS PTY - int32_t */
167 /** RBDS PTY - int32_t */
169 /** RDS RT - string */
171 /** Song title - string */
173 /** Artist name - string */
175 /** Album name - string */
177 /** Musical genre - string */
179 /** Station icon - raw (int32_t for HAL 1.1) */
181 /** Album art - raw (int32_t for HAL 1.1) */
183 /** Clock - MetaDataClock */
187 struct MetaDataClock {
188 /** Seconds since epoch at GMT + 0. */
189 uint64_t utcSecondsSinceEpoch;
190 /** Minutes offset from the GMT. */
191 int32_t timezoneOffsetInMinutes;
197 /** Value used for type MetadataType.INT */
199 /** Value used for type MetadataType.CLOCK */
200 MetaDataClock clockValue;
201 /** Value used for type MetadataType.TEXT */
203 /** Value used for type MetadataType.RAW */
204 vec<uint8_t> rawValue;
208 /* Radio program information. Returned by the HAL with event RADIO_EVENT_TUNED.
209 * Contains information on currently tuned channel.
212 uint32_t channel; /** current channel. (e.g kHz for band type AM_FM) */
213 uint32_t subChannel; /** current sub channel. (FM_HD) */
216 * Tuned to a program (not a noise). It's the same condition that would
217 * stop scan operation.
221 bool stereo; /** program is stereo or not */
222 bool digital; /** digital program or not (e.g HD Radio program) */
225 * Signal quality measured in 0% to 100% range.
227 * Despite the name, this is not a signal strength.
228 * The purpose of this field is primarily informative.
230 uint32_t signalStrength;
232 vec<MetaData> metadata; /** Metadata: PTY, song title etc. */