1 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_BLUETOOTH_AUDIO_V2_1_TYPES_H
2 #define HIDL_GENERATED_ANDROID_HARDWARE_BLUETOOTH_AUDIO_V2_1_TYPES_H
3
4 #include <android/hardware/bluetooth/audio/2.0/types.h>
5
6 #include <hidl/HidlSupport.h>
7 #include <hidl/MQDescriptor.h>
8 #include <utils/NativeHandle.h>
9 #include <utils/misc.h>
10
11 namespace android {
12 namespace hardware {
13 namespace bluetooth {
14 namespace audio {
15 namespace V2_1 {
16
17 // Forward declaration for forward reference support:
18 enum class SessionType : uint8_t;
19 enum class CodecType : uint32_t;
20 enum class SampleRate : uint32_t;
21 struct PcmParameters;
22 enum class Lc3FrameDuration : uint8_t;
23 struct Lc3Parameters;
24 struct Lc3CodecCapabilities;
25 struct AudioCapabilities;
26 struct Lc3CodecConfiguration;
27 struct AudioConfiguration;
28
29 enum class SessionType : uint8_t {
30 UNKNOWN = 0,
31 /**
32 * A2DP legacy that AVDTP media is encoded by Bluetooth Stack
33 */
34 A2DP_SOFTWARE_ENCODING_DATAPATH = 1 /* ::android::hardware::bluetooth::audio::V2_0::SessionType.UNKNOWN implicitly + 1 */,
35 /**
36 * The encoding of AVDTP media is done by HW and there is control only
37 */
38 A2DP_HARDWARE_OFFLOAD_DATAPATH = 2 /* ::android::hardware::bluetooth::audio::V2_0::SessionType.A2DP_SOFTWARE_ENCODING_DATAPATH implicitly + 1 */,
39 /**
40 * Used when encoded by Bluetooth Stack and streaming to Hearing Aid
41 */
42 HEARING_AID_SOFTWARE_ENCODING_DATAPATH = 3 /* ::android::hardware::bluetooth::audio::V2_0::SessionType.A2DP_HARDWARE_OFFLOAD_DATAPATH implicitly + 1 */,
43 /**
44 * Used when encoded by Bluetooth Stack and streaming to LE Audio device
45 */
46 LE_AUDIO_SOFTWARE_ENCODING_DATAPATH = 4 /* ::android::hardware::bluetooth::audio::V2_0::SessionType.HEARING_AID_SOFTWARE_ENCODING_DATAPATH implicitly + 1 */,
47 /**
48 * Used when decoded by Bluetooth Stack and streaming to audio framework
49 */
50 LE_AUDIO_SOFTWARE_DECODED_DATAPATH = 5 /* ::android::hardware::bluetooth::audio::V2_1::SessionType.LE_AUDIO_SOFTWARE_ENCODING_DATAPATH implicitly + 1 */,
51 /**
52 * Encoding is done by HW an there is control only
53 */
54 LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 6 /* ::android::hardware::bluetooth::audio::V2_1::SessionType.LE_AUDIO_SOFTWARE_DECODED_DATAPATH implicitly + 1 */,
55 /**
56 * Decoding is done by HW an there is control only
57 */
58 LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH = 7 /* ::android::hardware::bluetooth::audio::V2_1::SessionType.LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH implicitly + 1 */,
59 };
60
61 enum class CodecType : uint32_t {
62 UNKNOWN = 0u /* 0x00 */,
63 SBC = 1u /* 0x01 */,
64 AAC = 2u /* 0x02 */,
65 APTX = 4u /* 0x04 */,
66 APTX_HD = 8u /* 0x08 */,
67 LDAC = 16u /* 0x10 */,
68 LC3 = 32u /* 0x20 */,
69 };
70
71 enum class SampleRate : uint32_t {
72 RATE_UNKNOWN = 0u /* 0x00 */,
73 RATE_44100 = 1u /* 0x01 */,
74 RATE_48000 = 2u /* 0x02 */,
75 RATE_88200 = 4u /* 0x04 */,
76 RATE_96000 = 8u /* 0x08 */,
77 RATE_176400 = 16u /* 0x10 */,
78 RATE_192000 = 32u /* 0x20 */,
79 RATE_16000 = 64u /* 0x40 */,
80 RATE_24000 = 128u /* 0x80 */,
81 RATE_8000 = 256u /* 0x100 */,
82 RATE_32000 = 512u /* 0x200 */,
83 };
84
85 /**
86 * Used for Software Encoding audio feed parameters
87 */
88 struct PcmParameters final {
89 ::android::hardware::bluetooth::audio::V2_1::SampleRate sampleRate __attribute__ ((aligned(4)));
90 ::android::hardware::bluetooth::audio::V2_0::ChannelMode channelMode __attribute__ ((aligned(1)));
91 ::android::hardware::bluetooth::audio::V2_0::BitsPerSample bitsPerSample __attribute__ ((aligned(1)));
92 /**
93 * Data interval for data transfer
94 */
95 uint32_t dataIntervalUs __attribute__ ((aligned(4)));
96 };
97
98 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::PcmParameters, sampleRate) == 0, "wrong offset");
99 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::PcmParameters, channelMode) == 4, "wrong offset");
100 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::PcmParameters, bitsPerSample) == 5, "wrong offset");
101 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::PcmParameters, dataIntervalUs) == 8, "wrong offset");
102 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::PcmParameters) == 12, "wrong size");
103 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::PcmParameters) == 4, "wrong alignment");
104
105 enum class Lc3FrameDuration : uint8_t {
106 DURATION_10000US = 0 /* 0x00 */,
107 DURATION_7500US = 1 /* 0x01 */,
108 };
109
110 /**
111 * Used for Hardware Encoding/Decoding LC3 codec parameters.
112 */
113 struct Lc3Parameters final {
114 /*
115 * PCM is Input for encoder, Output for decoder
116 */
117 ::android::hardware::bluetooth::audio::V2_0::BitsPerSample pcmBitDepth __attribute__ ((aligned(1)));
118 /*
119 * codec-specific parameters
120 */
121 ::android::hardware::bluetooth::audio::V2_1::SampleRate samplingFrequency __attribute__ ((aligned(4)));
122 ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration frameDuration __attribute__ ((aligned(1)));
123 /*
124 * length in octets of a codec frame
125 */
126 uint32_t octetsPerFrame __attribute__ ((aligned(4)));
127 /*
128 * Number of blocks of codec frames per single SDU (Service Data Unit)
129 */
130 uint8_t blocksPerSdu __attribute__ ((aligned(1)));
131 };
132
133 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3Parameters, pcmBitDepth) == 0, "wrong offset");
134 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3Parameters, samplingFrequency) == 4, "wrong offset");
135 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3Parameters, frameDuration) == 8, "wrong offset");
136 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3Parameters, octetsPerFrame) == 12, "wrong offset");
137 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3Parameters, blocksPerSdu) == 16, "wrong offset");
138 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::Lc3Parameters) == 20, "wrong size");
139 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::Lc3Parameters) == 4, "wrong alignment");
140
141 /**
142 * Used to specify the capabilities of the LC3 codecs supported by Hardware Encoding.
143 */
144 struct Lc3CodecCapabilities final {
145 /*
146 * This is bitfield, if bit N is set, HW Offloader supports N+1 channels at the same time.
147 * Example: 0x27 = 0b00100111: One, two, three or six channels supported.
148 */
149 uint8_t supportedChannelCounts __attribute__ ((aligned(1)));
150 ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters lc3Capabilities __attribute__ ((aligned(4)));
151 };
152
153 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities, supportedChannelCounts) == 0, "wrong offset");
154 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities, lc3Capabilities) == 4, "wrong offset");
155 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities) == 24, "wrong size");
156 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities) == 4, "wrong alignment");
157
158 /**
159 * Used to specify the capabilities of the different session types
160 */
161 struct AudioCapabilities final {
162 enum class hidl_discriminator : uint8_t {
163 pcmCapabilities = 0, // ::android::hardware::bluetooth::audio::V2_1::PcmParameters
164 codecCapabilities = 1, // ::android::hardware::bluetooth::audio::V2_0::CodecCapabilities
165 leAudioCapabilities = 2, // ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities
166 };
167
168 AudioCapabilities();
169 ~AudioCapabilities();
170 AudioCapabilities(AudioCapabilities&&);
171 AudioCapabilities(const AudioCapabilities&);
172 AudioCapabilities& operator=(AudioCapabilities&&);
173 AudioCapabilities& operator=(const AudioCapabilities&);
174
175 void pcmCapabilities(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters&);
176 void pcmCapabilities(::android::hardware::bluetooth::audio::V2_1::PcmParameters&&);
177 ::android::hardware::bluetooth::audio::V2_1::PcmParameters& pcmCapabilities();
178 const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& pcmCapabilities() const;
179
180 void codecCapabilities(const ::android::hardware::bluetooth::audio::V2_0::CodecCapabilities&);
181 void codecCapabilities(::android::hardware::bluetooth::audio::V2_0::CodecCapabilities&&);
182 ::android::hardware::bluetooth::audio::V2_0::CodecCapabilities& codecCapabilities();
183 const ::android::hardware::bluetooth::audio::V2_0::CodecCapabilities& codecCapabilities() const;
184
185 void leAudioCapabilities(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities&);
186 void leAudioCapabilities(::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities&&);
187 ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& leAudioCapabilities();
188 const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& leAudioCapabilities() const;
189
190 // Utility methods
191 hidl_discriminator getDiscriminator() const;
192
hidl_getUnionOffsetfinal193 constexpr size_t hidl_getUnionOffset() const {
194 return offsetof(::android::hardware::bluetooth::audio::V2_1::AudioCapabilities, hidl_u);
195 }
196
197 private:
198 void hidl_destructUnion();
199
200 hidl_discriminator hidl_d __attribute__ ((aligned(1))) ;
201 union hidl_union final {
202 ::android::hardware::bluetooth::audio::V2_1::PcmParameters pcmCapabilities __attribute__ ((aligned(4)));
203 ::android::hardware::bluetooth::audio::V2_0::CodecCapabilities codecCapabilities __attribute__ ((aligned(4)));
204 ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities leAudioCapabilities __attribute__ ((aligned(4)));
205
206 hidl_union();
207 ~hidl_union();
208 } hidl_u;
209
210 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_union) == 24, "wrong size");
211 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_union) == 4, "wrong alignment");
212 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_discriminator) == 1, "wrong size");
213 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_discriminator) == 1, "wrong alignment");
214 };
215
216 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::AudioCapabilities) == 28, "wrong size");
217 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::AudioCapabilities) == 4, "wrong alignment");
218
219 /**
220 * Used to configure a LC3 Hardware Encoding session.
221 */
222 struct Lc3CodecConfiguration final {
223 /*
224 * This is also bitfield, specifying how the channels are ordered in the outgoing media packet.
225 * Bit meaning is defined in Bluetooth Assigned Numbers.
226 */
227 uint32_t audioChannelAllocation __attribute__ ((aligned(4)));
228 ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters lc3Config __attribute__ ((aligned(4)));
229 };
230
231 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration, audioChannelAllocation) == 0, "wrong offset");
232 static_assert(offsetof(::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration, lc3Config) == 4, "wrong offset");
233 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration) == 24, "wrong size");
234 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration) == 4, "wrong alignment");
235
236 /**
237 * Used to configure either a Hardware or Software Encoding session based on session type
238 */
239 struct AudioConfiguration final {
240 enum class hidl_discriminator : uint8_t {
241 pcmConfig = 0, // ::android::hardware::bluetooth::audio::V2_1::PcmParameters
242 codecConfig = 1, // ::android::hardware::bluetooth::audio::V2_0::CodecConfiguration
243 leAudioCodecConfig = 2, // ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration
244 };
245
246 AudioConfiguration();
247 ~AudioConfiguration();
248 AudioConfiguration(AudioConfiguration&&);
249 AudioConfiguration(const AudioConfiguration&);
250 AudioConfiguration& operator=(AudioConfiguration&&);
251 AudioConfiguration& operator=(const AudioConfiguration&);
252
253 void pcmConfig(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters&);
254 void pcmConfig(::android::hardware::bluetooth::audio::V2_1::PcmParameters&&);
255 ::android::hardware::bluetooth::audio::V2_1::PcmParameters& pcmConfig();
256 const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& pcmConfig() const;
257
258 void codecConfig(const ::android::hardware::bluetooth::audio::V2_0::CodecConfiguration&);
259 void codecConfig(::android::hardware::bluetooth::audio::V2_0::CodecConfiguration&&);
260 ::android::hardware::bluetooth::audio::V2_0::CodecConfiguration& codecConfig();
261 const ::android::hardware::bluetooth::audio::V2_0::CodecConfiguration& codecConfig() const;
262
263 void leAudioCodecConfig(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration&);
264 void leAudioCodecConfig(::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration&&);
265 ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& leAudioCodecConfig();
266 const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& leAudioCodecConfig() const;
267
268 // Utility methods
269 hidl_discriminator getDiscriminator() const;
270
hidl_getUnionOffsetfinal271 constexpr size_t hidl_getUnionOffset() const {
272 return offsetof(::android::hardware::bluetooth::audio::V2_1::AudioConfiguration, hidl_u);
273 }
274
275 private:
276 void hidl_destructUnion();
277
278 hidl_discriminator hidl_d __attribute__ ((aligned(1))) ;
279 union hidl_union final {
280 ::android::hardware::bluetooth::audio::V2_1::PcmParameters pcmConfig __attribute__ ((aligned(4)));
281 ::android::hardware::bluetooth::audio::V2_0::CodecConfiguration codecConfig __attribute__ ((aligned(4)));
282 ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration leAudioCodecConfig __attribute__ ((aligned(4)));
283
284 hidl_union();
285 ~hidl_union();
286 } hidl_u;
287
288 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_union) == 28, "wrong size");
289 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_union) == 4, "wrong alignment");
290 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_discriminator) == 1, "wrong size");
291 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_discriminator) == 1, "wrong alignment");
292 };
293
294 static_assert(sizeof(::android::hardware::bluetooth::audio::V2_1::AudioConfiguration) == 32, "wrong size");
295 static_assert(__alignof(::android::hardware::bluetooth::audio::V2_1::AudioConfiguration) == 4, "wrong alignment");
296
297 //
298 // type declarations for package
299 //
300
301 template<typename>
302 static inline std::string toString(uint8_t o);
303 static inline std::string toString(::android::hardware::bluetooth::audio::V2_1::SessionType o);
304 static inline void PrintTo(::android::hardware::bluetooth::audio::V2_1::SessionType o, ::std::ostream* os);
305 constexpr uint8_t operator|(const ::android::hardware::bluetooth::audio::V2_1::SessionType lhs, const ::android::hardware::bluetooth::audio::V2_1::SessionType rhs) {
306 return static_cast<uint8_t>(static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
307 }
308 constexpr uint8_t operator|(const uint8_t lhs, const ::android::hardware::bluetooth::audio::V2_1::SessionType rhs) {
309 return static_cast<uint8_t>(lhs | static_cast<uint8_t>(rhs));
310 }
311 constexpr uint8_t operator|(const ::android::hardware::bluetooth::audio::V2_1::SessionType lhs, const uint8_t rhs) {
312 return static_cast<uint8_t>(static_cast<uint8_t>(lhs) | rhs);
313 }
314 constexpr uint8_t operator&(const ::android::hardware::bluetooth::audio::V2_1::SessionType lhs, const ::android::hardware::bluetooth::audio::V2_1::SessionType rhs) {
315 return static_cast<uint8_t>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
316 }
317 constexpr uint8_t operator&(const uint8_t lhs, const ::android::hardware::bluetooth::audio::V2_1::SessionType rhs) {
318 return static_cast<uint8_t>(lhs & static_cast<uint8_t>(rhs));
319 }
320 constexpr uint8_t operator&(const ::android::hardware::bluetooth::audio::V2_1::SessionType lhs, const uint8_t rhs) {
321 return static_cast<uint8_t>(static_cast<uint8_t>(lhs) & rhs);
322 }
323 constexpr uint8_t &operator|=(uint8_t& v, const ::android::hardware::bluetooth::audio::V2_1::SessionType e) {
324 v |= static_cast<uint8_t>(e);
325 return v;
326 }
327 constexpr uint8_t &operator&=(uint8_t& v, const ::android::hardware::bluetooth::audio::V2_1::SessionType e) {
328 v &= static_cast<uint8_t>(e);
329 return v;
330 }
331
332 template<typename>
333 static inline std::string toString(uint32_t o);
334 static inline std::string toString(::android::hardware::bluetooth::audio::V2_1::CodecType o);
335 static inline void PrintTo(::android::hardware::bluetooth::audio::V2_1::CodecType o, ::std::ostream* os);
336 constexpr uint32_t operator|(const ::android::hardware::bluetooth::audio::V2_1::CodecType lhs, const ::android::hardware::bluetooth::audio::V2_1::CodecType rhs) {
337 return static_cast<uint32_t>(static_cast<uint32_t>(lhs) | static_cast<uint32_t>(rhs));
338 }
339 constexpr uint32_t operator|(const uint32_t lhs, const ::android::hardware::bluetooth::audio::V2_1::CodecType rhs) {
340 return static_cast<uint32_t>(lhs | static_cast<uint32_t>(rhs));
341 }
342 constexpr uint32_t operator|(const ::android::hardware::bluetooth::audio::V2_1::CodecType lhs, const uint32_t rhs) {
343 return static_cast<uint32_t>(static_cast<uint32_t>(lhs) | rhs);
344 }
345 constexpr uint32_t operator&(const ::android::hardware::bluetooth::audio::V2_1::CodecType lhs, const ::android::hardware::bluetooth::audio::V2_1::CodecType rhs) {
346 return static_cast<uint32_t>(static_cast<uint32_t>(lhs) & static_cast<uint32_t>(rhs));
347 }
348 constexpr uint32_t operator&(const uint32_t lhs, const ::android::hardware::bluetooth::audio::V2_1::CodecType rhs) {
349 return static_cast<uint32_t>(lhs & static_cast<uint32_t>(rhs));
350 }
351 constexpr uint32_t operator&(const ::android::hardware::bluetooth::audio::V2_1::CodecType lhs, const uint32_t rhs) {
352 return static_cast<uint32_t>(static_cast<uint32_t>(lhs) & rhs);
353 }
354 constexpr uint32_t &operator|=(uint32_t& v, const ::android::hardware::bluetooth::audio::V2_1::CodecType e) {
355 v |= static_cast<uint32_t>(e);
356 return v;
357 }
358 constexpr uint32_t &operator&=(uint32_t& v, const ::android::hardware::bluetooth::audio::V2_1::CodecType e) {
359 v &= static_cast<uint32_t>(e);
360 return v;
361 }
362
363 template<typename>
364 static inline std::string toString(uint32_t o);
365 static inline std::string toString(::android::hardware::bluetooth::audio::V2_1::SampleRate o);
366 static inline void PrintTo(::android::hardware::bluetooth::audio::V2_1::SampleRate o, ::std::ostream* os);
367 constexpr uint32_t operator|(const ::android::hardware::bluetooth::audio::V2_1::SampleRate lhs, const ::android::hardware::bluetooth::audio::V2_1::SampleRate rhs) {
368 return static_cast<uint32_t>(static_cast<uint32_t>(lhs) | static_cast<uint32_t>(rhs));
369 }
370 constexpr uint32_t operator|(const uint32_t lhs, const ::android::hardware::bluetooth::audio::V2_1::SampleRate rhs) {
371 return static_cast<uint32_t>(lhs | static_cast<uint32_t>(rhs));
372 }
373 constexpr uint32_t operator|(const ::android::hardware::bluetooth::audio::V2_1::SampleRate lhs, const uint32_t rhs) {
374 return static_cast<uint32_t>(static_cast<uint32_t>(lhs) | rhs);
375 }
376 constexpr uint32_t operator&(const ::android::hardware::bluetooth::audio::V2_1::SampleRate lhs, const ::android::hardware::bluetooth::audio::V2_1::SampleRate rhs) {
377 return static_cast<uint32_t>(static_cast<uint32_t>(lhs) & static_cast<uint32_t>(rhs));
378 }
379 constexpr uint32_t operator&(const uint32_t lhs, const ::android::hardware::bluetooth::audio::V2_1::SampleRate rhs) {
380 return static_cast<uint32_t>(lhs & static_cast<uint32_t>(rhs));
381 }
382 constexpr uint32_t operator&(const ::android::hardware::bluetooth::audio::V2_1::SampleRate lhs, const uint32_t rhs) {
383 return static_cast<uint32_t>(static_cast<uint32_t>(lhs) & rhs);
384 }
385 constexpr uint32_t &operator|=(uint32_t& v, const ::android::hardware::bluetooth::audio::V2_1::SampleRate e) {
386 v |= static_cast<uint32_t>(e);
387 return v;
388 }
389 constexpr uint32_t &operator&=(uint32_t& v, const ::android::hardware::bluetooth::audio::V2_1::SampleRate e) {
390 v &= static_cast<uint32_t>(e);
391 return v;
392 }
393
394 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& o);
395 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& o, ::std::ostream*);
396 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& lhs, const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& rhs);
397 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& lhs, const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& rhs);
398
399 template<typename>
400 static inline std::string toString(uint8_t o);
401 static inline std::string toString(::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration o);
402 static inline void PrintTo(::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration o, ::std::ostream* os);
403 constexpr uint8_t operator|(const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration rhs) {
404 return static_cast<uint8_t>(static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
405 }
406 constexpr uint8_t operator|(const uint8_t lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration rhs) {
407 return static_cast<uint8_t>(lhs | static_cast<uint8_t>(rhs));
408 }
409 constexpr uint8_t operator|(const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration lhs, const uint8_t rhs) {
410 return static_cast<uint8_t>(static_cast<uint8_t>(lhs) | rhs);
411 }
412 constexpr uint8_t operator&(const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration rhs) {
413 return static_cast<uint8_t>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
414 }
415 constexpr uint8_t operator&(const uint8_t lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration rhs) {
416 return static_cast<uint8_t>(lhs & static_cast<uint8_t>(rhs));
417 }
418 constexpr uint8_t operator&(const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration lhs, const uint8_t rhs) {
419 return static_cast<uint8_t>(static_cast<uint8_t>(lhs) & rhs);
420 }
421 constexpr uint8_t &operator|=(uint8_t& v, const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration e) {
422 v |= static_cast<uint8_t>(e);
423 return v;
424 }
425 constexpr uint8_t &operator&=(uint8_t& v, const ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration e) {
426 v &= static_cast<uint8_t>(e);
427 return v;
428 }
429
430 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& o);
431 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& o, ::std::ostream*);
432 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& rhs);
433 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& rhs);
434
435 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& o);
436 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& o, ::std::ostream*);
437 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& rhs);
438 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& rhs);
439
440 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& o);
441 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& o, ::std::ostream*);
442 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& lhs, const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& rhs);
443 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& lhs, const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& rhs);
444
445 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& o);
446 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& o, ::std::ostream*);
447 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& rhs);
448 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& rhs);
449
450 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& o);
451 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& o, ::std::ostream*);
452 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& lhs, const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& rhs);
453 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& lhs, const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& rhs);
454
455 //
456 // type header definitions for package
457 //
458
459 template<>
460 inline std::string toString<::android::hardware::bluetooth::audio::V2_1::SessionType>(uint8_t o) {
461 using ::android::hardware::details::toHexString;
462 std::string os;
463 ::android::hardware::hidl_bitfield<::android::hardware::bluetooth::audio::V2_1::SessionType> flipped = 0;
464 bool first = true;
465 if ((o & ::android::hardware::bluetooth::audio::V2_1::SessionType::UNKNOWN) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::SessionType::UNKNOWN)) {
466 os += (first ? "" : " | ");
467 os += "UNKNOWN";
468 first = false;
469 flipped |= ::android::hardware::bluetooth::audio::V2_1::SessionType::UNKNOWN;
470 }
471 if ((o & ::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH)) {
472 os += (first ? "" : " | ");
473 os += "A2DP_SOFTWARE_ENCODING_DATAPATH";
474 first = false;
475 flipped |= ::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH;
476 }
477 if ((o & ::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_HARDWARE_OFFLOAD_DATAPATH) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_HARDWARE_OFFLOAD_DATAPATH)) {
478 os += (first ? "" : " | ");
479 os += "A2DP_HARDWARE_OFFLOAD_DATAPATH";
480 first = false;
481 flipped |= ::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_HARDWARE_OFFLOAD_DATAPATH;
482 }
483 if ((o & ::android::hardware::bluetooth::audio::V2_1::SessionType::HEARING_AID_SOFTWARE_ENCODING_DATAPATH) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::SessionType::HEARING_AID_SOFTWARE_ENCODING_DATAPATH)) {
484 os += (first ? "" : " | ");
485 os += "HEARING_AID_SOFTWARE_ENCODING_DATAPATH";
486 first = false;
487 flipped |= ::android::hardware::bluetooth::audio::V2_1::SessionType::HEARING_AID_SOFTWARE_ENCODING_DATAPATH;
488 }
489 if ((o & ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH)) {
490 os += (first ? "" : " | ");
491 os += "LE_AUDIO_SOFTWARE_ENCODING_DATAPATH";
492 first = false;
493 flipped |= ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH;
494 }
495 if ((o & ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_DECODED_DATAPATH) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_DECODED_DATAPATH)) {
496 os += (first ? "" : " | ");
497 os += "LE_AUDIO_SOFTWARE_DECODED_DATAPATH";
498 first = false;
499 flipped |= ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_DECODED_DATAPATH;
500 }
501 if ((o & ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH)) {
502 os += (first ? "" : " | ");
503 os += "LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH";
504 first = false;
505 flipped |= ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH;
506 }
507 if ((o & ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH)) {
508 os += (first ? "" : " | ");
509 os += "LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH";
510 first = false;
511 flipped |= ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH;
512 }
513 if (o != flipped) {
514 os += (first ? "" : " | ");
515 os += toHexString(o & (~flipped));
516 }os += " (";
517 os += toHexString(o);
518 os += ")";
519 return os;
520 }
521
toString(::android::hardware::bluetooth::audio::V2_1::SessionType o)522 static inline std::string toString(::android::hardware::bluetooth::audio::V2_1::SessionType o) {
523 using ::android::hardware::details::toHexString;
524 if (o == ::android::hardware::bluetooth::audio::V2_1::SessionType::UNKNOWN) {
525 return "UNKNOWN";
526 }
527 if (o == ::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH) {
528 return "A2DP_SOFTWARE_ENCODING_DATAPATH";
529 }
530 if (o == ::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_HARDWARE_OFFLOAD_DATAPATH) {
531 return "A2DP_HARDWARE_OFFLOAD_DATAPATH";
532 }
533 if (o == ::android::hardware::bluetooth::audio::V2_1::SessionType::HEARING_AID_SOFTWARE_ENCODING_DATAPATH) {
534 return "HEARING_AID_SOFTWARE_ENCODING_DATAPATH";
535 }
536 if (o == ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH) {
537 return "LE_AUDIO_SOFTWARE_ENCODING_DATAPATH";
538 }
539 if (o == ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_DECODED_DATAPATH) {
540 return "LE_AUDIO_SOFTWARE_DECODED_DATAPATH";
541 }
542 if (o == ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
543 return "LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH";
544 }
545 if (o == ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
546 return "LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH";
547 }
548 std::string os;
549 os += toHexString(static_cast<uint8_t>(o));
550 return os;
551 }
552
PrintTo(::android::hardware::bluetooth::audio::V2_1::SessionType o,::std::ostream * os)553 static inline void PrintTo(::android::hardware::bluetooth::audio::V2_1::SessionType o, ::std::ostream* os) {
554 *os << toString(o);
555 }
556
557 template<>
558 inline std::string toString<::android::hardware::bluetooth::audio::V2_1::CodecType>(uint32_t o) {
559 using ::android::hardware::details::toHexString;
560 std::string os;
561 ::android::hardware::hidl_bitfield<::android::hardware::bluetooth::audio::V2_1::CodecType> flipped = 0;
562 bool first = true;
563 if ((o & ::android::hardware::bluetooth::audio::V2_1::CodecType::UNKNOWN) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::CodecType::UNKNOWN)) {
564 os += (first ? "" : " | ");
565 os += "UNKNOWN";
566 first = false;
567 flipped |= ::android::hardware::bluetooth::audio::V2_1::CodecType::UNKNOWN;
568 }
569 if ((o & ::android::hardware::bluetooth::audio::V2_1::CodecType::SBC) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::CodecType::SBC)) {
570 os += (first ? "" : " | ");
571 os += "SBC";
572 first = false;
573 flipped |= ::android::hardware::bluetooth::audio::V2_1::CodecType::SBC;
574 }
575 if ((o & ::android::hardware::bluetooth::audio::V2_1::CodecType::AAC) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::CodecType::AAC)) {
576 os += (first ? "" : " | ");
577 os += "AAC";
578 first = false;
579 flipped |= ::android::hardware::bluetooth::audio::V2_1::CodecType::AAC;
580 }
581 if ((o & ::android::hardware::bluetooth::audio::V2_1::CodecType::APTX) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::CodecType::APTX)) {
582 os += (first ? "" : " | ");
583 os += "APTX";
584 first = false;
585 flipped |= ::android::hardware::bluetooth::audio::V2_1::CodecType::APTX;
586 }
587 if ((o & ::android::hardware::bluetooth::audio::V2_1::CodecType::APTX_HD) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::CodecType::APTX_HD)) {
588 os += (first ? "" : " | ");
589 os += "APTX_HD";
590 first = false;
591 flipped |= ::android::hardware::bluetooth::audio::V2_1::CodecType::APTX_HD;
592 }
593 if ((o & ::android::hardware::bluetooth::audio::V2_1::CodecType::LDAC) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::CodecType::LDAC)) {
594 os += (first ? "" : " | ");
595 os += "LDAC";
596 first = false;
597 flipped |= ::android::hardware::bluetooth::audio::V2_1::CodecType::LDAC;
598 }
599 if ((o & ::android::hardware::bluetooth::audio::V2_1::CodecType::LC3) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::CodecType::LC3)) {
600 os += (first ? "" : " | ");
601 os += "LC3";
602 first = false;
603 flipped |= ::android::hardware::bluetooth::audio::V2_1::CodecType::LC3;
604 }
605 if (o != flipped) {
606 os += (first ? "" : " | ");
607 os += toHexString(o & (~flipped));
608 }os += " (";
609 os += toHexString(o);
610 os += ")";
611 return os;
612 }
613
toString(::android::hardware::bluetooth::audio::V2_1::CodecType o)614 static inline std::string toString(::android::hardware::bluetooth::audio::V2_1::CodecType o) {
615 using ::android::hardware::details::toHexString;
616 if (o == ::android::hardware::bluetooth::audio::V2_1::CodecType::UNKNOWN) {
617 return "UNKNOWN";
618 }
619 if (o == ::android::hardware::bluetooth::audio::V2_1::CodecType::SBC) {
620 return "SBC";
621 }
622 if (o == ::android::hardware::bluetooth::audio::V2_1::CodecType::AAC) {
623 return "AAC";
624 }
625 if (o == ::android::hardware::bluetooth::audio::V2_1::CodecType::APTX) {
626 return "APTX";
627 }
628 if (o == ::android::hardware::bluetooth::audio::V2_1::CodecType::APTX_HD) {
629 return "APTX_HD";
630 }
631 if (o == ::android::hardware::bluetooth::audio::V2_1::CodecType::LDAC) {
632 return "LDAC";
633 }
634 if (o == ::android::hardware::bluetooth::audio::V2_1::CodecType::LC3) {
635 return "LC3";
636 }
637 std::string os;
638 os += toHexString(static_cast<uint32_t>(o));
639 return os;
640 }
641
PrintTo(::android::hardware::bluetooth::audio::V2_1::CodecType o,::std::ostream * os)642 static inline void PrintTo(::android::hardware::bluetooth::audio::V2_1::CodecType o, ::std::ostream* os) {
643 *os << toString(o);
644 }
645
646 template<>
647 inline std::string toString<::android::hardware::bluetooth::audio::V2_1::SampleRate>(uint32_t o) {
648 using ::android::hardware::details::toHexString;
649 std::string os;
650 ::android::hardware::hidl_bitfield<::android::hardware::bluetooth::audio::V2_1::SampleRate> flipped = 0;
651 bool first = true;
652 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_UNKNOWN) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_UNKNOWN)) {
653 os += (first ? "" : " | ");
654 os += "RATE_UNKNOWN";
655 first = false;
656 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_UNKNOWN;
657 }
658 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_44100) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_44100)) {
659 os += (first ? "" : " | ");
660 os += "RATE_44100";
661 first = false;
662 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_44100;
663 }
664 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_48000) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_48000)) {
665 os += (first ? "" : " | ");
666 os += "RATE_48000";
667 first = false;
668 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_48000;
669 }
670 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_88200) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_88200)) {
671 os += (first ? "" : " | ");
672 os += "RATE_88200";
673 first = false;
674 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_88200;
675 }
676 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_96000) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_96000)) {
677 os += (first ? "" : " | ");
678 os += "RATE_96000";
679 first = false;
680 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_96000;
681 }
682 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_176400) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_176400)) {
683 os += (first ? "" : " | ");
684 os += "RATE_176400";
685 first = false;
686 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_176400;
687 }
688 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_192000) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_192000)) {
689 os += (first ? "" : " | ");
690 os += "RATE_192000";
691 first = false;
692 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_192000;
693 }
694 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_16000) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_16000)) {
695 os += (first ? "" : " | ");
696 os += "RATE_16000";
697 first = false;
698 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_16000;
699 }
700 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_24000) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_24000)) {
701 os += (first ? "" : " | ");
702 os += "RATE_24000";
703 first = false;
704 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_24000;
705 }
706 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_8000) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_8000)) {
707 os += (first ? "" : " | ");
708 os += "RATE_8000";
709 first = false;
710 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_8000;
711 }
712 if ((o & ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_32000) == static_cast<uint32_t>(::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_32000)) {
713 os += (first ? "" : " | ");
714 os += "RATE_32000";
715 first = false;
716 flipped |= ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_32000;
717 }
718 if (o != flipped) {
719 os += (first ? "" : " | ");
720 os += toHexString(o & (~flipped));
721 }os += " (";
722 os += toHexString(o);
723 os += ")";
724 return os;
725 }
726
toString(::android::hardware::bluetooth::audio::V2_1::SampleRate o)727 static inline std::string toString(::android::hardware::bluetooth::audio::V2_1::SampleRate o) {
728 using ::android::hardware::details::toHexString;
729 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_UNKNOWN) {
730 return "RATE_UNKNOWN";
731 }
732 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_44100) {
733 return "RATE_44100";
734 }
735 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_48000) {
736 return "RATE_48000";
737 }
738 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_88200) {
739 return "RATE_88200";
740 }
741 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_96000) {
742 return "RATE_96000";
743 }
744 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_176400) {
745 return "RATE_176400";
746 }
747 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_192000) {
748 return "RATE_192000";
749 }
750 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_16000) {
751 return "RATE_16000";
752 }
753 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_24000) {
754 return "RATE_24000";
755 }
756 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_8000) {
757 return "RATE_8000";
758 }
759 if (o == ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_32000) {
760 return "RATE_32000";
761 }
762 std::string os;
763 os += toHexString(static_cast<uint32_t>(o));
764 return os;
765 }
766
PrintTo(::android::hardware::bluetooth::audio::V2_1::SampleRate o,::std::ostream * os)767 static inline void PrintTo(::android::hardware::bluetooth::audio::V2_1::SampleRate o, ::std::ostream* os) {
768 *os << toString(o);
769 }
770
toString(const::android::hardware::bluetooth::audio::V2_1::PcmParameters & o)771 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& o) {
772 using ::android::hardware::toString;
773 std::string os;
774 os += "{";
775 os += ".sampleRate = ";
776 os += ::android::hardware::bluetooth::audio::V2_1::toString(o.sampleRate);
777 os += ", .channelMode = ";
778 os += ::android::hardware::bluetooth::audio::V2_0::toString(o.channelMode);
779 os += ", .bitsPerSample = ";
780 os += ::android::hardware::bluetooth::audio::V2_0::toString(o.bitsPerSample);
781 os += ", .dataIntervalUs = ";
782 os += ::android::hardware::toString(o.dataIntervalUs);
783 os += "}"; return os;
784 }
785
PrintTo(const::android::hardware::bluetooth::audio::V2_1::PcmParameters & o,::std::ostream * os)786 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& o, ::std::ostream* os) {
787 *os << toString(o);
788 }
789
790 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& lhs, const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& rhs) {
791 if (lhs.sampleRate != rhs.sampleRate) {
792 return false;
793 }
794 if (lhs.channelMode != rhs.channelMode) {
795 return false;
796 }
797 if (lhs.bitsPerSample != rhs.bitsPerSample) {
798 return false;
799 }
800 if (lhs.dataIntervalUs != rhs.dataIntervalUs) {
801 return false;
802 }
803 return true;
804 }
805
806 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& lhs, const ::android::hardware::bluetooth::audio::V2_1::PcmParameters& rhs){
807 return !(lhs == rhs);
808 }
809
810 template<>
811 inline std::string toString<::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration>(uint8_t o) {
812 using ::android::hardware::details::toHexString;
813 std::string os;
814 ::android::hardware::hidl_bitfield<::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration> flipped = 0;
815 bool first = true;
816 if ((o & ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_10000US) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_10000US)) {
817 os += (first ? "" : " | ");
818 os += "DURATION_10000US";
819 first = false;
820 flipped |= ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_10000US;
821 }
822 if ((o & ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_7500US) == static_cast<uint8_t>(::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_7500US)) {
823 os += (first ? "" : " | ");
824 os += "DURATION_7500US";
825 first = false;
826 flipped |= ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_7500US;
827 }
828 if (o != flipped) {
829 os += (first ? "" : " | ");
830 os += toHexString(o & (~flipped));
831 }os += " (";
832 os += toHexString(o);
833 os += ")";
834 return os;
835 }
836
toString(::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration o)837 static inline std::string toString(::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration o) {
838 using ::android::hardware::details::toHexString;
839 if (o == ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_10000US) {
840 return "DURATION_10000US";
841 }
842 if (o == ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_7500US) {
843 return "DURATION_7500US";
844 }
845 std::string os;
846 os += toHexString(static_cast<uint8_t>(o));
847 return os;
848 }
849
PrintTo(::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration o,::std::ostream * os)850 static inline void PrintTo(::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration o, ::std::ostream* os) {
851 *os << toString(o);
852 }
853
toString(const::android::hardware::bluetooth::audio::V2_1::Lc3Parameters & o)854 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& o) {
855 using ::android::hardware::toString;
856 std::string os;
857 os += "{";
858 os += ".pcmBitDepth = ";
859 os += ::android::hardware::bluetooth::audio::V2_0::toString(o.pcmBitDepth);
860 os += ", .samplingFrequency = ";
861 os += ::android::hardware::bluetooth::audio::V2_1::toString(o.samplingFrequency);
862 os += ", .frameDuration = ";
863 os += ::android::hardware::bluetooth::audio::V2_1::toString(o.frameDuration);
864 os += ", .octetsPerFrame = ";
865 os += ::android::hardware::toString(o.octetsPerFrame);
866 os += ", .blocksPerSdu = ";
867 os += ::android::hardware::toString(o.blocksPerSdu);
868 os += "}"; return os;
869 }
870
PrintTo(const::android::hardware::bluetooth::audio::V2_1::Lc3Parameters & o,::std::ostream * os)871 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& o, ::std::ostream* os) {
872 *os << toString(o);
873 }
874
875 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& rhs) {
876 if (lhs.pcmBitDepth != rhs.pcmBitDepth) {
877 return false;
878 }
879 if (lhs.samplingFrequency != rhs.samplingFrequency) {
880 return false;
881 }
882 if (lhs.frameDuration != rhs.frameDuration) {
883 return false;
884 }
885 if (lhs.octetsPerFrame != rhs.octetsPerFrame) {
886 return false;
887 }
888 if (lhs.blocksPerSdu != rhs.blocksPerSdu) {
889 return false;
890 }
891 return true;
892 }
893
894 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters& rhs){
895 return !(lhs == rhs);
896 }
897
toString(const::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities & o)898 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& o) {
899 using ::android::hardware::toString;
900 std::string os;
901 os += "{";
902 os += ".supportedChannelCounts = ";
903 os += ::android::hardware::toString(o.supportedChannelCounts);
904 os += ", .lc3Capabilities = ";
905 os += ::android::hardware::bluetooth::audio::V2_1::toString(o.lc3Capabilities);
906 os += "}"; return os;
907 }
908
PrintTo(const::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities & o,::std::ostream * os)909 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& o, ::std::ostream* os) {
910 *os << toString(o);
911 }
912
913 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& rhs) {
914 if (lhs.supportedChannelCounts != rhs.supportedChannelCounts) {
915 return false;
916 }
917 if (lhs.lc3Capabilities != rhs.lc3Capabilities) {
918 return false;
919 }
920 return true;
921 }
922
923 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecCapabilities& rhs){
924 return !(lhs == rhs);
925 }
926
toString(const::android::hardware::bluetooth::audio::V2_1::AudioCapabilities & o)927 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& o) {
928 using ::android::hardware::toString;
929 std::string os;
930 os += "{";
931
932 switch (o.getDiscriminator()) {
933 case ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_discriminator::pcmCapabilities: {
934 os += ".pcmCapabilities = ";
935 os += toString(o.pcmCapabilities());
936 break;
937 }
938 case ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_discriminator::codecCapabilities: {
939 os += ".codecCapabilities = ";
940 os += toString(o.codecCapabilities());
941 break;
942 }
943 case ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_discriminator::leAudioCapabilities: {
944 os += ".leAudioCapabilities = ";
945 os += toString(o.leAudioCapabilities());
946 break;
947 }
948 default: {
949 ::android::hardware::details::logAlwaysFatal((
950 "Unknown union discriminator (value: " +
951 std::to_string(static_cast<uint8_t>(o.getDiscriminator())) + ").").c_str());
952 }
953 }
954 os += "}"; return os;
955 }
956
PrintTo(const::android::hardware::bluetooth::audio::V2_1::AudioCapabilities & o,::std::ostream * os)957 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& o, ::std::ostream* os) {
958 *os << toString(o);
959 }
960
961 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& lhs, const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& rhs) {
962 if (lhs.getDiscriminator() != rhs.getDiscriminator()) {
963 return false;
964 }
965 switch (lhs.getDiscriminator()) {
966 case ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_discriminator::pcmCapabilities: {
967 return (lhs.pcmCapabilities() == rhs.pcmCapabilities());
968 }
969 case ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_discriminator::codecCapabilities: {
970 return (lhs.codecCapabilities() == rhs.codecCapabilities());
971 }
972 case ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities::hidl_discriminator::leAudioCapabilities: {
973 return (lhs.leAudioCapabilities() == rhs.leAudioCapabilities());
974 }
975 default: {
976 ::android::hardware::details::logAlwaysFatal((
977 "Unknown union discriminator (value: " +
978 std::to_string(static_cast<uint8_t>(lhs.getDiscriminator())) + ").").c_str());
979 }
980 }
981 return true;
982 }
983
984 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& lhs, const ::android::hardware::bluetooth::audio::V2_1::AudioCapabilities& rhs){
985 return !(lhs == rhs);
986 }
987
toString(const::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration & o)988 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& o) {
989 using ::android::hardware::toString;
990 std::string os;
991 os += "{";
992 os += ".audioChannelAllocation = ";
993 os += ::android::hardware::toString(o.audioChannelAllocation);
994 os += ", .lc3Config = ";
995 os += ::android::hardware::bluetooth::audio::V2_1::toString(o.lc3Config);
996 os += "}"; return os;
997 }
998
PrintTo(const::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration & o,::std::ostream * os)999 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& o, ::std::ostream* os) {
1000 *os << toString(o);
1001 }
1002
1003 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& rhs) {
1004 if (lhs.audioChannelAllocation != rhs.audioChannelAllocation) {
1005 return false;
1006 }
1007 if (lhs.lc3Config != rhs.lc3Config) {
1008 return false;
1009 }
1010 return true;
1011 }
1012
1013 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& lhs, const ::android::hardware::bluetooth::audio::V2_1::Lc3CodecConfiguration& rhs){
1014 return !(lhs == rhs);
1015 }
1016
toString(const::android::hardware::bluetooth::audio::V2_1::AudioConfiguration & o)1017 static inline std::string toString(const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& o) {
1018 using ::android::hardware::toString;
1019 std::string os;
1020 os += "{";
1021
1022 switch (o.getDiscriminator()) {
1023 case ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_discriminator::pcmConfig: {
1024 os += ".pcmConfig = ";
1025 os += toString(o.pcmConfig());
1026 break;
1027 }
1028 case ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_discriminator::codecConfig: {
1029 os += ".codecConfig = ";
1030 os += toString(o.codecConfig());
1031 break;
1032 }
1033 case ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_discriminator::leAudioCodecConfig: {
1034 os += ".leAudioCodecConfig = ";
1035 os += toString(o.leAudioCodecConfig());
1036 break;
1037 }
1038 default: {
1039 ::android::hardware::details::logAlwaysFatal((
1040 "Unknown union discriminator (value: " +
1041 std::to_string(static_cast<uint8_t>(o.getDiscriminator())) + ").").c_str());
1042 }
1043 }
1044 os += "}"; return os;
1045 }
1046
PrintTo(const::android::hardware::bluetooth::audio::V2_1::AudioConfiguration & o,::std::ostream * os)1047 static inline void PrintTo(const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& o, ::std::ostream* os) {
1048 *os << toString(o);
1049 }
1050
1051 static inline bool operator==(const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& lhs, const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& rhs) {
1052 if (lhs.getDiscriminator() != rhs.getDiscriminator()) {
1053 return false;
1054 }
1055 switch (lhs.getDiscriminator()) {
1056 case ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_discriminator::pcmConfig: {
1057 return (lhs.pcmConfig() == rhs.pcmConfig());
1058 }
1059 case ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_discriminator::codecConfig: {
1060 return (lhs.codecConfig() == rhs.codecConfig());
1061 }
1062 case ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::hidl_discriminator::leAudioCodecConfig: {
1063 return (lhs.leAudioCodecConfig() == rhs.leAudioCodecConfig());
1064 }
1065 default: {
1066 ::android::hardware::details::logAlwaysFatal((
1067 "Unknown union discriminator (value: " +
1068 std::to_string(static_cast<uint8_t>(lhs.getDiscriminator())) + ").").c_str());
1069 }
1070 }
1071 return true;
1072 }
1073
1074 static inline bool operator!=(const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& lhs, const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration& rhs){
1075 return !(lhs == rhs);
1076 }
1077
1078
1079 } // namespace V2_1
1080 } // namespace audio
1081 } // namespace bluetooth
1082 } // namespace hardware
1083 } // namespace android
1084
1085 //
1086 // global type declarations for package
1087 //
1088
1089 namespace android {
1090 namespace hardware {
1091 namespace details {
1092 #pragma clang diagnostic push
1093 #pragma clang diagnostic ignored "-Wc++17-extensions"
1094 template<> inline constexpr std::array<::android::hardware::bluetooth::audio::V2_1::SessionType, 8> hidl_enum_values<::android::hardware::bluetooth::audio::V2_1::SessionType> = {
1095 ::android::hardware::bluetooth::audio::V2_1::SessionType::UNKNOWN,
1096 ::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH,
1097 ::android::hardware::bluetooth::audio::V2_1::SessionType::A2DP_HARDWARE_OFFLOAD_DATAPATH,
1098 ::android::hardware::bluetooth::audio::V2_1::SessionType::HEARING_AID_SOFTWARE_ENCODING_DATAPATH,
1099 ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH,
1100 ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_SOFTWARE_DECODED_DATAPATH,
1101 ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH,
1102 ::android::hardware::bluetooth::audio::V2_1::SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH,
1103 };
1104 #pragma clang diagnostic pop
1105 } // namespace details
1106 } // namespace hardware
1107 } // namespace android
1108
1109 namespace android {
1110 namespace hardware {
1111 namespace details {
1112 #pragma clang diagnostic push
1113 #pragma clang diagnostic ignored "-Wc++17-extensions"
1114 template<> inline constexpr std::array<::android::hardware::bluetooth::audio::V2_1::CodecType, 7> hidl_enum_values<::android::hardware::bluetooth::audio::V2_1::CodecType> = {
1115 ::android::hardware::bluetooth::audio::V2_1::CodecType::UNKNOWN,
1116 ::android::hardware::bluetooth::audio::V2_1::CodecType::SBC,
1117 ::android::hardware::bluetooth::audio::V2_1::CodecType::AAC,
1118 ::android::hardware::bluetooth::audio::V2_1::CodecType::APTX,
1119 ::android::hardware::bluetooth::audio::V2_1::CodecType::APTX_HD,
1120 ::android::hardware::bluetooth::audio::V2_1::CodecType::LDAC,
1121 ::android::hardware::bluetooth::audio::V2_1::CodecType::LC3,
1122 };
1123 #pragma clang diagnostic pop
1124 } // namespace details
1125 } // namespace hardware
1126 } // namespace android
1127
1128 namespace android {
1129 namespace hardware {
1130 namespace details {
1131 #pragma clang diagnostic push
1132 #pragma clang diagnostic ignored "-Wc++17-extensions"
1133 template<> inline constexpr std::array<::android::hardware::bluetooth::audio::V2_1::SampleRate, 11> hidl_enum_values<::android::hardware::bluetooth::audio::V2_1::SampleRate> = {
1134 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_UNKNOWN,
1135 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_44100,
1136 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_48000,
1137 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_88200,
1138 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_96000,
1139 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_176400,
1140 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_192000,
1141 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_16000,
1142 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_24000,
1143 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_8000,
1144 ::android::hardware::bluetooth::audio::V2_1::SampleRate::RATE_32000,
1145 };
1146 #pragma clang diagnostic pop
1147 } // namespace details
1148 } // namespace hardware
1149 } // namespace android
1150
1151 namespace android {
1152 namespace hardware {
1153 namespace details {
1154 #pragma clang diagnostic push
1155 #pragma clang diagnostic ignored "-Wc++17-extensions"
1156 template<> inline constexpr std::array<::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration, 2> hidl_enum_values<::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration> = {
1157 ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_10000US,
1158 ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration::DURATION_7500US,
1159 };
1160 #pragma clang diagnostic pop
1161 } // namespace details
1162 } // namespace hardware
1163 } // namespace android
1164
1165
1166 #endif // HIDL_GENERATED_ANDROID_HARDWARE_BLUETOOTH_AUDIO_V2_1_TYPES_H
1167