1*5deb0bb6SMatthias Ringwald /* 2*5deb0bb6SMatthias Ringwald * Copyright (C) 2022 BlueKitchen GmbH 3*5deb0bb6SMatthias Ringwald * 4*5deb0bb6SMatthias Ringwald * Redistribution and use in source and binary forms, with or without 5*5deb0bb6SMatthias Ringwald * modification, are permitted provided that the following conditions 6*5deb0bb6SMatthias Ringwald * are met: 7*5deb0bb6SMatthias Ringwald * 8*5deb0bb6SMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 9*5deb0bb6SMatthias Ringwald * notice, this list of conditions and the following disclaimer. 10*5deb0bb6SMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 11*5deb0bb6SMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 12*5deb0bb6SMatthias Ringwald * documentation and/or other materials provided with the distribution. 13*5deb0bb6SMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 14*5deb0bb6SMatthias Ringwald * contributors may be used to endorse or promote products derived 15*5deb0bb6SMatthias Ringwald * from this software without specific prior written permission. 16*5deb0bb6SMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 17*5deb0bb6SMatthias Ringwald * personal benefit and not for any commercial purpose or for 18*5deb0bb6SMatthias Ringwald * monetary gain. 19*5deb0bb6SMatthias Ringwald * 20*5deb0bb6SMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 21*5deb0bb6SMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22*5deb0bb6SMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23*5deb0bb6SMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN 24*5deb0bb6SMatthias Ringwald * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25*5deb0bb6SMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26*5deb0bb6SMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27*5deb0bb6SMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28*5deb0bb6SMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29*5deb0bb6SMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30*5deb0bb6SMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31*5deb0bb6SMatthias Ringwald * SUCH DAMAGE. 32*5deb0bb6SMatthias Ringwald * 33*5deb0bb6SMatthias Ringwald * Please inquire about commercial licensing options at 34*5deb0bb6SMatthias Ringwald * [email protected] 35*5deb0bb6SMatthias Ringwald * 36*5deb0bb6SMatthias Ringwald */ 37*5deb0bb6SMatthias Ringwald 38*5deb0bb6SMatthias Ringwald /** 39*5deb0bb6SMatthias Ringwald * @title Volume Offset Control Service Server 40*5deb0bb6SMatthias Ringwald * 41*5deb0bb6SMatthias Ringwald */ 42*5deb0bb6SMatthias Ringwald 43*5deb0bb6SMatthias Ringwald #ifndef LE_AUDIO_H 44*5deb0bb6SMatthias Ringwald #define LE_AUDIO_H 45*5deb0bb6SMatthias Ringwald 46*5deb0bb6SMatthias Ringwald #include <stdint.h> 47*5deb0bb6SMatthias Ringwald 48*5deb0bb6SMatthias Ringwald #include "bluetooth.h" 49*5deb0bb6SMatthias Ringwald 50*5deb0bb6SMatthias Ringwald #if defined __cplusplus 51*5deb0bb6SMatthias Ringwald extern "C" { 52*5deb0bb6SMatthias Ringwald #endif 53*5deb0bb6SMatthias Ringwald 54*5deb0bb6SMatthias Ringwald #define LE_AUDIO_MAX_CODEC_CONFIG_SIZE 19 55*5deb0bb6SMatthias Ringwald #define LE_CCIDS_MAX_NUM 10 56*5deb0bb6SMatthias Ringwald 57*5deb0bb6SMatthias Ringwald #define LE_AUDIO_PROGRAM_INFO_MAX_LENGTH 20 58*5deb0bb6SMatthias Ringwald #define LE_AUDIO_PROGRAM_INFO_URI_MAX_LENGTH 20 59*5deb0bb6SMatthias Ringwald #define LE_AUDIO_EXTENDED_METADATA_MAX_LENGHT 20 60*5deb0bb6SMatthias Ringwald #define LE_AUDIO_VENDOR_SPECIFIC_METADATA_MAX_LENGTH 20 61*5deb0bb6SMatthias Ringwald 62*5deb0bb6SMatthias Ringwald // Generic Audio/Audio Location Definitions/Bitmap 63*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_NOT_ALLOWED 0x00000000 64*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_FRONT_LEFT 0x00000001 65*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_FRONT_RIGHT 0x00000002 66*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_FRONT_CENTER 0x00000004 67*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_LOW_FREQUENCY_EFFECTS1 0x00000008 68*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_BACK_LEFT 0x00000010 69*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_BACK_RIGHT 0x00000020 70*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_FRONT_LEFT_OF_CENTER 0x00000040 71*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_FRONT_RIGHT_OF_CENTER 0x00000080 72*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_BACK_CENTER 0x00000100 73*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_LOW_FREQUENCY_EFFECTS2 0x00000200 74*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_SIDE_LEFT 0x00000400 75*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_SIDE_RIGHT 0x00000800 76*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_FRONT_LEFT 0x00001000 77*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_FRONT_RIGHT 0x00002000 78*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_FRONT_CENTER 0x00004000 79*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_CENTER 0x00008000 80*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_BACK_LEFT 0x00010000 81*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_BACK_RIGHT 0x00020000 82*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_SIDE_LEFT 0x00040000 83*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_SIDE_RIGHT 0x00080000 84*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_TOP_BACK_CENTER 0x00100000 85*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_BOTTOM_FRONT_CENTER 0x00200000 86*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_BOTTOM_FRONT_LEFT 0x00400000 87*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_BOTTOM_FRONT_RIGHT 0x00800000 88*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_FRONT_LEFT_WIDE 0x01000000 89*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_FRONT_RIGHT_WIDE 0x02000000 90*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_LEFT_SURROUND 0x04000000 91*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_RIGHT_SURROUND 0x08000000 92*5deb0bb6SMatthias Ringwald #define LE_AUDIO_LOCATION_MASK_RFU 0xF0000000 93*5deb0bb6SMatthias Ringwald 94*5deb0bb6SMatthias Ringwald // Generic Audio/Context Mask 95*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_PROHIBITED 0x0000 96*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_UNSPECIFIED 0x0001 97*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_CONVERSATIONAL 0x0002 // Conversation between humans, for example, in telephony or video calls, including traditional cellular as well as VoIP and Push-to-Talk 98*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_MEDIA 0x0004 // Media, for example, music playback, radio, podcast or movie soundtrack, or tv audio 99*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_GAME 0x0008 // Audio associated with video gaming, for example gaming media; gaming effects; music and in-game voice chat between participants; or a mix of all the above 100*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_INSTRUCTIONAL 0x0010 // Instructional audio, for example, in navigation, announcements, or user guidance 101*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_VOICE_ASSISTANTS 0x0020 // Man-machine communication, for example, with voice recognition or virtual assistants 102*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_LIVE 0x0040 // Live audio, for example, from a microphone where audio is perceived both through a direct acoustic path and through an LE Audio Stream 103*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_SOUND_EFFECTS 0x0080 // Sound effects including keyboard and touch feedback; menu and user interface sounds; and other system sounds 104*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_NOTIFICATIONS 0x0100 // Notification and reminder sounds; attention-seeking audio, for example, in beeps signaling the arrival of a message 105*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_RINGTONE 0x0200 // Alerts the user to an incoming call, for example, an incoming telephony or video call, including traditional cellular as well as VoIP and Push-to-Talk 106*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_ALERTS 0x0400 // Alarms and timers; immediate alerts, for example, in a critical battery alarm, timer expiry or alarm clock, toaster, cooker, kettle, microwave, etc. 107*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_EMERGENCY_ALARM 0x0800 //Emergency alarm Emergency sounds, for example, fire alarms or other urgent alerts 108*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CONTEXT_MASK_RFU 0xF000 109*5deb0bb6SMatthias Ringwald 110*5deb0bb6SMatthias Ringwald #define LE_AUDIO_OTC_MIN_OBJECT_ID_VALUE 0x000000000100 111*5deb0bb6SMatthias Ringwald #define LE_AUDIO_OTC_MAX_OBJECT_ID_VALUE 0xFFFFFFFFFFFF 112*5deb0bb6SMatthias Ringwald 113*5deb0bb6SMatthias Ringwald // ASCS: Framing for Codec Configured State 114*5deb0bb6SMatthias Ringwald #define LE_AUDIO_UNFRAMED_ISOAL_MASK_PDUS_SUPPORTED 0x00 115*5deb0bb6SMatthias Ringwald #define LE_AUDIO_UNFRAMED_ISOAL_MASK_PDUS_NOT_SUPPORTED 0x01 116*5deb0bb6SMatthias Ringwald 117*5deb0bb6SMatthias Ringwald // ASCS: Server responds with bitmap values: PHY Bitmap for Codec Configured State 118*5deb0bb6SMatthias Ringwald #define LE_AUDIO_SERVER_PHY_MASK_NO_PREFERENCE 0x00 119*5deb0bb6SMatthias Ringwald #define LE_AUDIO_SERVER_PHY_MASK_1M 0x01 120*5deb0bb6SMatthias Ringwald #define LE_AUDIO_SERVER_PHY_MASK_2M 0x02 121*5deb0bb6SMatthias Ringwald #define LE_AUDIO_SERVER_PHY_MASK_CODED 0x04 122*5deb0bb6SMatthias Ringwald 123*5deb0bb6SMatthias Ringwald // ASCS: Latency for Codec Configured State 124*5deb0bb6SMatthias Ringwald #define LE_AUDIO_SERVER_LATENCY_MASK_NO_PREFERENCE 0x00 125*5deb0bb6SMatthias Ringwald #define LE_AUDIO_SERVER_LATENCY_MASK_LOW 0x01 126*5deb0bb6SMatthias Ringwald #define LE_AUDIO_SERVER_LATENCY_MASK_BALANCED 0x02 127*5deb0bb6SMatthias Ringwald #define LE_AUDIO_SERVER_LATENCY_MASK_HIGH 0x04 128*5deb0bb6SMatthias Ringwald 129*5deb0bb6SMatthias Ringwald typedef enum { 130*5deb0bb6SMatthias Ringwald LE_AUDIO_ROLE_SINK = 0, 131*5deb0bb6SMatthias Ringwald LE_AUDIO_ROLE_SOURCE 132*5deb0bb6SMatthias Ringwald } le_audio_role_t; 133*5deb0bb6SMatthias Ringwald 134*5deb0bb6SMatthias Ringwald // GA Codec_Specific_Configuration LTV structures 135*5deb0bb6SMatthias Ringwald typedef enum { 136*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CONFIGURATION_TYPE_UNDEFINED = 0x00, 137*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CONFIGURATION_TYPE_SAMPLING_FREQUENCY = 0x01, 138*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CONFIGURATION_TYPE_FRAME_DURATION, 139*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CONFIGURATION_TYPE_AUDIO_CHANNEL_ALLOCATION, 140*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CONFIGURATION_TYPE_OCTETS_PER_CODEC_FRAME, 141*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CONFIGURATION_TYPE_CODEC_FRAME_BLOCKS_PER_SDU, 142*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CONFIGURATION_TYPE_RFU 143*5deb0bb6SMatthias Ringwald } le_audio_codec_configuration_type_t; 144*5deb0bb6SMatthias Ringwald 145*5deb0bb6SMatthias Ringwald typedef enum { 146*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CAPABILITY_TYPE_SAMPLING_FREQUENCY = 0x01, 147*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CAPABILITY_TYPE_FRAME_DURATION, 148*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CAPABILITY_TYPE_SUPPORTED_AUDIO_CHANNEL_COUNTS, 149*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CAPABILITY_TYPE_OCTETS_PER_CODEC_FRAME, 150*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CAPABILITY_TYPE_CODEC_FRAME_BLOCKS_PER_SDU, 151*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_CAPABILITY_TYPE_RFU 152*5deb0bb6SMatthias Ringwald } le_audio_codec_capability_type_t; 153*5deb0bb6SMatthias Ringwald 154*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_8000_HZ 0x0001 155*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_11025_HZ 0x0002 156*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_16000_HZ 0x0004 157*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_22050_HZ 0x0008 158*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_24000_HZ 0x0010 159*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_32000_HZ 0x0020 160*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_44100_HZ 0x0040 161*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_48000_HZ 0x0080 162*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_88200_HZ 0x0100 163*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_96000_HZ 0x0200 164*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_176400_HZ 0x0400 165*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_192000_HZ 0x0800 166*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_SAMPLING_FREQUENCY_MASK_384000_HZ 0x1000 167*5deb0bb6SMatthias Ringwald 168*5deb0bb6SMatthias Ringwald typedef enum { 169*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_INVALID = 0x00, 170*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_8000_HZ, 171*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_11025_HZ, 172*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_16000_HZ, 173*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_22050_HZ, 174*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_24000_HZ, 175*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_32000_HZ, 176*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_44100_HZ, 177*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_48000_HZ, 178*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_88200_HZ, 179*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_96000_HZ, 180*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_176400_HZ, 181*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_192000_HZ, 182*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_384000_HZ, 183*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_SAMPLING_FREQUENCY_INDEX_RFU 184*5deb0bb6SMatthias Ringwald } le_audio_codec_sampling_frequency_index_t; 185*5deb0bb6SMatthias Ringwald 186*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_FRAME_DURATION_MASK_7500US 0x00 187*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_FRAME_DURATION_MASK_10000US 0x01 188*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_FRAME_DURATION_MASK_7500US_PREFERRED 0x08 189*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_FRAME_DURATION_MASK_10000US_PREFERRED 0x10 190*5deb0bb6SMatthias Ringwald 191*5deb0bb6SMatthias Ringwald typedef enum { 192*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_FRAME_DURATION_INDEX_INVALID = 0x00, 193*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_FRAME_DURATION_INDEX_7500US, 194*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_FRAME_DURATION_INDEX_10000US, 195*5deb0bb6SMatthias Ringwald LE_AUDIO_CODEC_FRAME_DURATION_INDEX_RFU 196*5deb0bb6SMatthias Ringwald } le_audio_codec_frame_duration_index_t; 197*5deb0bb6SMatthias Ringwald 198*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_AUDIO_CHANNEL_COUNT_MASK_1 0x01 199*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_AUDIO_CHANNEL_COUNT_MASK_2 0x02 200*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_AUDIO_CHANNEL_COUNT_MASK_3 0x04 201*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_AUDIO_CHANNEL_COUNT_MASK_4 0x08 202*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_AUDIO_CHANNEL_COUNT_MASK_5 0x10 203*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_AUDIO_CHANNEL_COUNT_MASK_6 0x20 204*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_AUDIO_CHANNEL_COUNT_MASK_7 0x40 205*5deb0bb6SMatthias Ringwald #define LE_AUDIO_CODEC_AUDIO_CHANNEL_COUNT_MASK_8 0x80 206*5deb0bb6SMatthias Ringwald 207*5deb0bb6SMatthias Ringwald 208*5deb0bb6SMatthias Ringwald // GA Metadata LTV structures 209*5deb0bb6SMatthias Ringwald 210*5deb0bb6SMatthias Ringwald typedef enum { 211*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_INVALID = 0x00, 212*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_PREFERRED_AUDIO_CONTEXTS = 0x01, 213*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_STREAMING_AUDIO_CONTEXTS, 214*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_PROGRAM_INFO, 215*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_LANGUAGE, 216*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_CCID_LIST, 217*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_PARENTAL_RATING, 218*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI, 219*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_MAPPED_EXTENDED_METADATA_BIT_POSITION, 220*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_MAPPED_VENDOR_SPECIFIC_METADATA_BIT_POSITION, 221*5deb0bb6SMatthias Ringwald // also used to indicate invalid packet type 222*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_RFU, 223*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_EXTENDED_METADATA = 0xFE, // mapped on RFU 224*5deb0bb6SMatthias Ringwald LE_AUDIO_METADATA_TYPE_VENDOR_SPECIFIC_METADATA = 0xFF // mapped on RFU+1 225*5deb0bb6SMatthias Ringwald } le_audio_metadata_type_t; 226*5deb0bb6SMatthias Ringwald 227*5deb0bb6SMatthias Ringwald typedef enum { 228*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_NO_RATING = 0, 229*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_ANY_AGE, 230*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_AGE_2, 231*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_AGE_3, 232*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_AGE_4, 233*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_AGE_6, 234*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_AGE_7, 235*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_AGE_8, 236*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_AGE_9, 237*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_AGE_10, 238*5deb0bb6SMatthias Ringwald LE_AUDIO_PARENTAL_RATING_RFU = 0x08 239*5deb0bb6SMatthias Ringwald } le_audio_parental_rating_t; 240*5deb0bb6SMatthias Ringwald 241*5deb0bb6SMatthias Ringwald 242*5deb0bb6SMatthias Ringwald typedef enum { 243*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_LATENCY_NO_PREFERENCE = 0, 244*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_LATENCY_LOW_LATENCY, 245*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_LATENCY_BALANCED_LATENCY_AND_RELIABILITY, 246*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_LATENCY_HIGH_RELIABILITY, 247*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_LATENCY_RFU, 248*5deb0bb6SMatthias Ringwald } le_audio_client_target_latency_t; 249*5deb0bb6SMatthias Ringwald 250*5deb0bb6SMatthias Ringwald typedef enum { 251*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_PHY_NO_PREFERENCE = 0, 252*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_PHY_LOW, 253*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_PHY_BALANCED, 254*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_PHY_HIGH, 255*5deb0bb6SMatthias Ringwald LE_AUDIO_CLIENT_TARGET_PHY_RFU 256*5deb0bb6SMatthias Ringwald } le_audio_client_target_phy_t; 257*5deb0bb6SMatthias Ringwald 258*5deb0bb6SMatthias Ringwald // struct for codec id 259*5deb0bb6SMatthias Ringwald typedef struct { 260*5deb0bb6SMatthias Ringwald hci_audio_coding_format_t coding_format; 261*5deb0bb6SMatthias Ringwald uint16_t company_id; 262*5deb0bb6SMatthias Ringwald uint16_t vendor_specific_codec_id; 263*5deb0bb6SMatthias Ringwald } le_audio_codec_id_t; 264*5deb0bb6SMatthias Ringwald 265*5deb0bb6SMatthias Ringwald 266*5deb0bb6SMatthias Ringwald typedef enum { 267*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_DO_NOT_SYNCHRONIZE_TO_PA = 0x00, 268*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_SYNCHRONIZE_TO_PA_PAST_AVAILABLE, 269*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_SYNCHRONIZE_TO_PA_PAST_NOT_AVAILABLE, 270*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_RFU 271*5deb0bb6SMatthias Ringwald } le_audio_pa_sync_t; 272*5deb0bb6SMatthias Ringwald 273*5deb0bb6SMatthias Ringwald typedef enum { 274*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_STATE_NOT_SYNCHRONIZED_TO_PA = 0x00, 275*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_STATE_SYNCINFO_REQUEST, 276*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_STATE_SYNCHRONIZED_TO_PA, 277*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_STATE_FAILED_TO_SYNCHRONIZE_TO_PA, 278*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_STATE_NO_PAST, 279*5deb0bb6SMatthias Ringwald LE_AUDIO_PA_SYNC_STATE_RFU 280*5deb0bb6SMatthias Ringwald } le_audio_pa_sync_state_t; 281*5deb0bb6SMatthias Ringwald 282*5deb0bb6SMatthias Ringwald typedef enum { 283*5deb0bb6SMatthias Ringwald LE_AUDIO_BIG_ENCRYPTION_NOT_ENCRYPTED = 0x00, 284*5deb0bb6SMatthias Ringwald LE_AUDIO_BIG_ENCRYPTION_BROADCAST_CODE_REQUIRED, 285*5deb0bb6SMatthias Ringwald LE_AUDIO_BIG_ENCRYPTION_DECRYPTING, 286*5deb0bb6SMatthias Ringwald LE_AUDIO_BIG_ENCRYPTION_BAD_CODE, 287*5deb0bb6SMatthias Ringwald LE_AUDIO_BIG_ENCRYPTION_RFU 288*5deb0bb6SMatthias Ringwald } le_audio_big_encryption_t; 289*5deb0bb6SMatthias Ringwald 290*5deb0bb6SMatthias Ringwald 291*5deb0bb6SMatthias Ringwald typedef struct { 292*5deb0bb6SMatthias Ringwald uint16_t metadata_mask; 293*5deb0bb6SMatthias Ringwald 294*5deb0bb6SMatthias Ringwald uint16_t preferred_audio_contexts_mask; 295*5deb0bb6SMatthias Ringwald uint16_t streaming_audio_contexts_mask; 296*5deb0bb6SMatthias Ringwald 297*5deb0bb6SMatthias Ringwald uint8_t program_info_length; 298*5deb0bb6SMatthias Ringwald uint8_t program_info[LE_AUDIO_PROGRAM_INFO_MAX_LENGTH]; 299*5deb0bb6SMatthias Ringwald 300*5deb0bb6SMatthias Ringwald uint32_t language_code; // 3-byte, lower case language code as defined in ISO 639-3 301*5deb0bb6SMatthias Ringwald 302*5deb0bb6SMatthias Ringwald uint8_t ccids_num; 303*5deb0bb6SMatthias Ringwald uint8_t ccids[LE_CCIDS_MAX_NUM]; 304*5deb0bb6SMatthias Ringwald 305*5deb0bb6SMatthias Ringwald le_audio_parental_rating_t parental_rating; 306*5deb0bb6SMatthias Ringwald 307*5deb0bb6SMatthias Ringwald uint8_t program_info_uri_length; 308*5deb0bb6SMatthias Ringwald uint8_t program_info_uri[LE_AUDIO_PROGRAM_INFO_URI_MAX_LENGTH]; 309*5deb0bb6SMatthias Ringwald 310*5deb0bb6SMatthias Ringwald uint16_t extended_metadata_type; 311*5deb0bb6SMatthias Ringwald uint8_t extended_metadata_length; 312*5deb0bb6SMatthias Ringwald uint8_t extended_metadata[LE_AUDIO_EXTENDED_METADATA_MAX_LENGHT]; 313*5deb0bb6SMatthias Ringwald 314*5deb0bb6SMatthias Ringwald uint16_t vendor_specific_company_id; 315*5deb0bb6SMatthias Ringwald uint8_t vendor_specific_metadata_length; 316*5deb0bb6SMatthias Ringwald uint8_t vendor_specific_metadata[LE_AUDIO_VENDOR_SPECIFIC_METADATA_MAX_LENGTH]; 317*5deb0bb6SMatthias Ringwald } le_audio_metadata_t; 318*5deb0bb6SMatthias Ringwald 319*5deb0bb6SMatthias Ringwald #if defined __cplusplus 320*5deb0bb6SMatthias Ringwald } 321*5deb0bb6SMatthias Ringwald #endif 322*5deb0bb6SMatthias Ringwald 323*5deb0bb6SMatthias Ringwald #endif 324*5deb0bb6SMatthias Ringwald 325