summaryrefslogtreecommitdiff
path: root/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
blob: a120e66bc3e6aed3e9d2a5cbc7c8b45f8765c0be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
/*
 * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following
 * disclaimer in the documentation and/or other materials provided with the
 * distribution.
 *
 * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from this
 * software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package com.smartdevicelink.proxy.rpc;

import androidx.annotation.NonNull;

import com.smartdevicelink.proxy.RPCStruct;

import java.util.Hashtable;

/**
 * Contains information about a radio control module's capabilities.
 */
public class RadioControlCapabilities extends RPCStruct {
    public static final String KEY_MODULE_NAME = "moduleName";
    public static final String KEY_RADIO_ENABLE_AVAILABLE = "radioEnableAvailable";
    public static final String KEY_RADIO_BAND_AVAILABLE = "radioBandAvailable";
    public static final String KEY_RADIO_FREQUENCY_AVAILABLE = "radioFrequencyAvailable";
    public static final String KEY_HD_CHANNEL_AVAILABLE = "hdChannelAvailable";
    public static final String KEY_RDS_DATA_AVAILABLE = "rdsDataAvailable";
    @Deprecated
    public static final String KEY_AVAILABLE_HDS_AVAILABLE = "availableHDsAvailable";
    public static final String KEY_STATE_AVAILABLE = "stateAvailable";
    public static final String KEY_SIGNAL_STRENGTH_AVAILABLE = "signalStrengthAvailable";
    public static final String KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE = "signalChangeThresholdAvailable";
    public static final String KEY_HD_RADIO_ENABLE_AVAILABLE = "hdRadioEnableAvailable";
    public static final String KEY_SIRIUS_XM_RADIO_AVAILABLE = "siriusxmRadioAvailable";
    public static final String KEY_SIS_DATA_AVAILABLE = "sisDataAvailable";
    public static final String KEY_MODULE_INFO = "moduleInfo";
    public static final String KEY_AVAILABLE_HD_CHANNELS_AVAILABLE = "availableHdChannelsAvailable";

    public RadioControlCapabilities() {
    }

    public RadioControlCapabilities(Hashtable<String, Object> hash) {
        super(hash);
    }

    /**
     * Constructs a new RadioControlCapabilities object
     *
     * @param moduleName The short friendly name of the radio control module.
     *                   It should not be used to identify a module by mobile application.
     */
    public RadioControlCapabilities(@NonNull String moduleName) {
        this();
        setModuleName(moduleName);
    }

    /**
     * Sets the moduleName portion of the RadioControlCapabilities class
     *
     * @param moduleName The short friendly name of the radio control module.
     *                   It should not be used to identify a module by mobile application.
     */
    public RadioControlCapabilities setModuleName(@NonNull String moduleName) {
        setValue(KEY_MODULE_NAME, moduleName);
        return this;
    }

    /**
     * Gets the moduleName portion of the RadioControlCapabilities class
     *
     * @return String - Short friendly name of the radio control module.
     */
    public String getModuleName() {
        return getString(KEY_MODULE_NAME);
    }

    /**
     * Sets the radioEnableAvailable portion of the RadioControlCapabilities class
     *
     * @param radioEnableAvailable Availability of the control of enable/disable radio.
     *                             True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setRadioEnableAvailable(Boolean radioEnableAvailable) {
        setValue(KEY_RADIO_ENABLE_AVAILABLE, radioEnableAvailable);
        return this;
    }

    /**
     * Gets the radioEnableAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the control of enable/disable radio.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getRadioEnableAvailable() {
        return getBoolean(KEY_RADIO_ENABLE_AVAILABLE);
    }

    /**
     * Sets the radioBandAvailable portion of the RadioControlCapabilities class
     *
     * @param radioBandAvailable Availability of the control of radio band.
     *                           True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setRadioBandAvailable(Boolean radioBandAvailable) {
        setValue(KEY_RADIO_BAND_AVAILABLE, radioBandAvailable);
        return this;
    }

    /**
     * Gets the radioBandAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the control of radio band.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getRadioBandAvailable() {
        return getBoolean(KEY_RADIO_BAND_AVAILABLE);
    }

    /**
     * Sets the radioFrequencyAvailable portion of the RadioControlCapabilities class
     *
     * @param radioFrequencyAvailable Availability of the control of radio frequency.
     *                                True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setRadioFrequencyAvailable(Boolean radioFrequencyAvailable) {
        setValue(KEY_RADIO_FREQUENCY_AVAILABLE, radioFrequencyAvailable);
        return this;
    }

    /**
     * Gets the radioFrequencyAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the control of radio frequency.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getRadioFrequencyAvailable() {
        return getBoolean(KEY_RADIO_FREQUENCY_AVAILABLE);
    }

    /**
     * Sets the hdChannelAvailable portion of the RadioControlCapabilities class
     *
     * @param hdChannelAvailable Availability of the control of HD radio channel.
     *                           True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setHdChannelAvailable(Boolean hdChannelAvailable) {
        setValue(KEY_HD_CHANNEL_AVAILABLE, hdChannelAvailable);
        return this;
    }

    /**
     * Gets the hdChannelAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the control of HD radio channel.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getHdChannelAvailable() {
        return getBoolean(KEY_HD_CHANNEL_AVAILABLE);
    }

    /**
     * Sets the rdsDataAvailable portion of the RadioControlCapabilities class
     *
     * @param rdsDataAvailable Availability of the getting Radio Data System (RDS) data.
     *                         True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setRdsDataAvailable(Boolean rdsDataAvailable) {
        setValue(KEY_RDS_DATA_AVAILABLE, rdsDataAvailable);
        return this;
    }

    /**
     * Gets the rdsDataAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the getting Radio Data System (RDS) data.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getRdsDataAvailable() {
        return getBoolean(KEY_RDS_DATA_AVAILABLE);
    }

    /**
     * Sets the availableHDsAvailable portion of the RadioControlCapabilities class
     *
     * @param availableHDsAvailable Availability of the getting the number of available HD channels.
     *                              True: Available, False: Not Available, Not present: Not Available.
     */
    @Deprecated
    public RadioControlCapabilities setAvailableHDsAvailable(Boolean availableHDsAvailable) {
        setValue(KEY_AVAILABLE_HDS_AVAILABLE, availableHDsAvailable);
        return this;
    }

    /**
     * Gets the availableHDsAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the getting the number of available HD channels.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    @Deprecated
    public Boolean getAvailableHDsAvailable() {
        return getBoolean(KEY_AVAILABLE_HDS_AVAILABLE);
    }

    /**
     * Sets the availableHdChannelsAvailable portion of the RadioControlCapabilities class
     *
     * @param availableHdChannelsAvailable Availability of the list of available HD sub-channel indexes.
     *                                     True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setAvailableHdChannelsAvailable(Boolean availableHdChannelsAvailable) {
        setValue(KEY_AVAILABLE_HD_CHANNELS_AVAILABLE, availableHdChannelsAvailable);
        return this;
    }

    /**
     * Gets the availableHdChannelsAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the list of available HD sub-channel indexes.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getAvailableHdChannelsAvailable() {
        return getBoolean(KEY_AVAILABLE_HD_CHANNELS_AVAILABLE);
    }

    /**
     * Sets the stateAvailable portion of the RadioControlCapabilities class
     *
     * @param stateAvailable Availability of the getting the Radio state.
     *                       True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setStateAvailable(Boolean stateAvailable) {
        setValue(KEY_STATE_AVAILABLE, stateAvailable);
        return this;
    }

    /**
     * Gets the stateAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the getting the Radio state.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getStateAvailable() {
        return getBoolean(KEY_STATE_AVAILABLE);
    }

    /**
     * Sets the signalStrengthAvailable portion of the RadioControlCapabilities class
     *
     * @param signalStrengthAvailable Availability of the getting the signal strength.
     *                                True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setSignalStrengthAvailable(Boolean signalStrengthAvailable) {
        setValue(KEY_SIGNAL_STRENGTH_AVAILABLE, signalStrengthAvailable);
        return this;
    }

    /**
     * Gets the signalStrengthAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the getting the signal strength.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getSignalStrengthAvailable() {
        return getBoolean(KEY_SIGNAL_STRENGTH_AVAILABLE);
    }

    /**
     * Sets the signalChangeThresholdAvailable portion of the RadioControlCapabilities class
     *
     * @param signalChangeThresholdAvailable Availability of the getting the signal Change Threshold.
     *                                       True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setSignalChangeThresholdAvailable(Boolean signalChangeThresholdAvailable) {
        setValue(KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, signalChangeThresholdAvailable);
        return this;
    }

    /**
     * Gets the signalChangeThresholdAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the getting the signal Change Threshold.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getSignalChangeThresholdAvailable() {
        return getBoolean(KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE);
    }

    /**
     * Sets the hdRadioEnableAvailable portion of the RadioControlCapabilities class
     *
     * @param hdRadioEnableAvailable Availability of the control of enable/disable HD radio.
     *                               True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setHdRadioEnableAvailable(Boolean hdRadioEnableAvailable) {
        setValue(KEY_HD_RADIO_ENABLE_AVAILABLE, hdRadioEnableAvailable);
        return this;
    }

    /**
     * Gets the hdRadioEnableAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the control of enable/disable HD radio.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getHdRadioEnableAvailable() {
        return getBoolean(KEY_HD_RADIO_ENABLE_AVAILABLE);
    }

    /**
     * Sets the siriusxmRadioAvailable portion of the RadioControlCapabilities class
     *
     * @param siriusxmRadioAvailable Availability of sirius XM radio.
     *                               True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setSiriusXMRadioAvailable(Boolean siriusxmRadioAvailable) {
        setValue(KEY_SIRIUS_XM_RADIO_AVAILABLE, siriusxmRadioAvailable);
        return this;
    }

    /**
     * Gets the siriusxmRadioAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of sirius XM radio.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getSiriusXMRadioAvailable() {
        return getBoolean(KEY_SIRIUS_XM_RADIO_AVAILABLE);
    }

    /**
     * Sets the sisDataAvailable portion of the RadioControlCapabilities class
     *
     * @param sisDataAvailable Availability of the getting HD radio Station Information Service (SIS) data.
     *                         True: Available, False: Not Available, Not present: Not Available.
     */
    public RadioControlCapabilities setSisDataAvailable(Boolean sisDataAvailable) {
        setValue(KEY_SIS_DATA_AVAILABLE, sisDataAvailable);
        return this;
    }

    /**
     * Gets the sisDataAvailable portion of the RadioControlCapabilities class
     *
     * @return Boolean - Availability of the getting HD radio Station Information Service (SIS) data.
     * True: Available, False: Not Available, Not present: Not Available.
     */
    public Boolean getSisDataAvailable() {
        return getBoolean(KEY_SIS_DATA_AVAILABLE);
    }

    /**
     * Sets ModuleInfo for this capability
     *
     * @param info the ModuleInfo to be set
     */
    public RadioControlCapabilities setModuleInfo(ModuleInfo info) {
        setValue(KEY_MODULE_INFO, info);
        return this;
    }

    /**
     * Gets a ModuleInfo of this capability
     *
     * @return module info of this capability
     */
    public ModuleInfo getModuleInfo() {
        return (ModuleInfo) getObject(ModuleInfo.class, KEY_MODULE_INFO);
    }
}