1#!/usr/bin/env python3 2# 3# Copyright 2018 - The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17"""Apollo PS Keys and User Sink Events.""" 18 19# Persistent Store (PS) Keys from rio_all_merged.psr. 20 21PSKEY = { 22 'PSKEY_BDADDR': '0x0001', 23 'PSKEY_DEVICE_NAME': '0x0108', 24 'PSKEY_DEEP_SLEEP_STATE': '0x0229', 25 'PSKEY_USB_VERSION': '0x02bc', 26 'PSKEY_USB_DEVICE_CLASS_CODES': '0x02bd', 27 'PSKEY_USB_VENDOR_ID': '0x02be', 28 'PSKEY_USB_PRODUCT_ID': '0x02bf', 29 'PSKEY_USB_PRODUCT_STRING': '0x02c2', 30 'PSKEY_USB_SERIAL_NUMBER_STRING': '0x02c3', 31 'PSKEY_EARCON_VERSION': '0x28b' 32} 33 34# Rio logging features from rio_log.h. 35 36LOG_FEATURES = { 37 'ALL': '0xffff', 38 'VERBOSE': '0x0001', 39 'TEST': '0x0002', 40 'CSR': '0x0004', 41 'DEBUG': '0x0008', 42 'INFO': '0x0010', 43 'ERROR': '0x0020', 44 'TIME_STAMP': '0x0040', 45} 46 47# Supported events from sink_events.h.""" 48 49SINK_EVENTS = { 50 'EventUsrMicOpen': '0x3206', 51 'EventUsrMicClose': '0x3207', 52 'EventUsrPowerOn': '0x4001', 53 'EventUsrPowerOff': '0x4002', 54 'EventUsrEnterPairing': '0x4003', 55 'EventUsrInitateVoiceDial': '0x4004', 56 'EventUsrInitateVoiceDial_AG2': '0x4005', 57 'EventUsrLastNumberRedial': '0x4006', 58 'EventUsrLastNumberRedial_AG2': '0x4007', 59 'EventUsrAnswer': '0x4008', 60 'EventUsrReject': '0x4009', 61 'EventUsrCancelEnd': '0x400A', 62 'EventUsrTransferToggle': '0x400B', 63 'EventUsrMuteToggle': '0x400C', 64 'EventUsrVolumeUp': '0x400D', 65 'EventUsrVolumeDown': '0x400E', 66 'EventUsrVolumeToggle': '0x400F', 67 'EventUsrThreeWayReleaseAllHeld': '0x4010', 68 'EventUsrThreeWayAcceptWaitingReleaseActive': '0x4011', 69 'EventUsrThreeWayAcceptWaitingHoldActive': '0x4012', 70 'EventUsrThreeWayAddHeldTo3Way': '0x4013', 71 'EventUsrThreeWayConnect2Disconnect': '0x4014', 72 'EventUsrLedsOnOffToggle': '0x4015', 73 'EventUsrLedsOn': '0x4016', 74 'EventUsrLedsOff': '0x4017', 75 'EventUsrEstablishSLC': '0x4018', 76 'EventUsrMuteOn': '0x4019', 77 'EventUsrMuteOff': '0x401A', 78 'EventUsrEnterTXContTestMode': '0x401B', 79 'EventUsrEnterDUTState': '0x401C', 80 'EventUsrBassBoostEnableDisableToggle': '0x401D', 81 'EventUsrPlaceIncomingCallOnHold': '0x401E', 82 'EventUsrAcceptHeldIncomingCall': '0x401F', 83 'EventUsrRejectHeldIncomingCall': '0x4020', 84 'EventUsrEnterDFUMode': '0x4021', 85 'EventUsrEnterDriverlessDFUMode': '0x4022', 86 'EventUsrEnterServiceMode': '0x4023', 87 'EventUsrAudioPromptsOn': '0x4024', 88 'EventUsrAudioPromptsOff': '0x4025', 89 'EventUsrDialStoredNumber': '0x4026', 90 'EventUsrUpdateStoredNumber': '0x4027', 91 'EventUsrRestoreDefaults': '0x4028', 92 'EventUsrConfirmationAccept': '0x4029', 93 'EventUsrConfirmationReject': '0x402A', 94 'EventUsrSelectAudioPromptLanguageMode': '0x402B', 95 'EventUsrSwitchAudioMode': '0x402F', 96 'EventUsrButtonLockingOn': '0x4030', 97 'EventUsrButtonLockingOff': '0x4031', 98 'EventUsrButtonLockingToggle': '0x4032', 99 'EventUsrRssiPair': '0x4034', 100 'EventUsrBassBoostOn': '0x4035', 101 'EventUsrBassBoostOff': '0x4036', 102 'EventUsr3DEnhancementOn': '0x4037', 103 'EventUsr3DEnhancementOff': '0x4038', 104 'EventUsrSelectAudioSourceNext': '0x4039', 105 'EventUsrSelectAudioSourceAnalog': '0x403A', 106 'EventUsrSelectAudioSourceUSB': '0x403B', 107 'EventUsrSelectAudioSourceAG1': '0x403C', 108 'EventUsrSelectAudioSourceAG2': '0x403D', 109 'EventUsrSelectFMAudioSource': '0x403E', 110 'EventUsrSelectAudioSourceNone': '0x403F', 111 'EventUsrPbapDialIch': '0x4040', 112 'EventUsrPbapDialMch': '0x4041', 113 'EventUsrIntelligentPowerManagementOn': '0x4042', 114 'EventUsrIntelligentPowerManagementOff': '0x4043', 115 'EventUsrIntelligentPowerManagementToggle': '0x4044', 116 'EventUsrAvrcpPlayPause': '0x4045', 117 'EventUsrAvrcpStop': '0x4046', 118 'EventUsrAvrcpSkipForward': '0x4047', 119 'EventUsrAvrcpSkipBackward': '0x4048', 120 'EventUsrAvrcpFastForwardPress': '0x4049', 121 'EventUsrAvrcpFastForwardRelease': '0x404A', 122 'EventUsrAvrcpRewindPress': '0x404B', 123 'EventUsrAvrcpRewindRelease': '0x404C', 124 'EventUsrAvrcpShuffleOff': '0x404D', 125 'EventUsrAvrcpShuffleAllTrack': '0x404E', 126 'EventUsrAvrcpShuffleGroup': '0x404F', 127 'EventUsrAvrcpRepeatOff': '0x4050', 128 'EventUsrAvrcpRepeatSingleTrack': '0x4051', 129 'EventUsrAvrcpRepeatAllTrack': '0x4052', 130 'EventUsrAvrcpRepeatGroup': '0x4053', 131 'EventUsrAvrcpPlay': '0x4054', 132 'EventUsrAvrcpPause': '0x4055', 133 'EventUsrAvrcpToggleActive': '0x4056', 134 'EventUsrAvrcpNextGroupPress': '0x4057', 135 'EventUsrAvrcpPreviousGroupPress': '0x4058', 136 'EventUsrPbapSetPhonebook': '0x4059', 137 'EventUsrPbapBrowseEntry': '0x405A', 138 'EventUsrPbapBrowseList': '0x405B', 139 'EventUsrPbapDownloadPhonebook': '0x405C', 140 'EventUsrPbapSelectPhonebookObject': '0x405D', 141 'EventUsrPbapBrowseComplete': '0x405E', 142 'EventUsrPbapGetPhonebookSize': '0x405F', 143 'EventUsrUsbPlayPause': '0x4060', 144 'EventUsrUsbStop': '0x4061', 145 'EventUsrUsbFwd': '0x4062', 146 'EventUsrUsbBack': '0x4063', 147 'EventUsrUsbMute': '0x4064', 148 'EventUsrUsbLowPowerMode': '0x4065', 149 'EventUsrTestModeAudio': '0x4066', 150 'EventUsrTestModeTone': '0x4067', 151 'EventUsrTestModeKey': '0x4068', 152 'EventUsrTestDefrag': '0x4069', 153 'EventUsrDebugKeysToggle': '0x406A', 154 'EventUsrSpeechRecognitionTuningStart': '0x406B', 155 'EventUsrWbsTestSetCodecs': '0x406C', 156 'EventUsrWbsTestOverrideResponse': '0x406D', 157 'EventUsrWbsTestSetCodecsSendBAC': '0x406E', 158 'EventUsrCreateAudioConnection': '0x406F', 159 'EventUsrSwapA2dpMediaChannel': '0x407F', 160 'EventUsrExternalMicConnected': '0x4080', 161 'EventUsrExternalMicDisconnected': '0x4081', 162 'EventUsrSSROn': '0x4082', 163 'EventUsrSSROff': '0x4083', 164 'EventUsrPeerSessionInquire': '0x4089', 165 'EventUsrPeerSessionConnDisc': '0x408A', 166 'EventUsrPeerSessionEnd': '0x408B', 167 'EventUsrBatteryLevelRequest': '0x408C', 168 'EventUsrVolumeOrientationNormal': '0x408D', 169 'EventUsrVolumeOrientationInvert': '0x408E', 170 'EventUsrResetPairedDeviceList': '0x408F', 171 'EventUsrEnterDutMode': '0x4090', 172 'EventUsr3DEnhancementEnableDisableToggle': '0x4091', 173 'EventUsrRCVolumeUp': '0x4092', 174 'EventUsrRCVolumeDown': '0x4093', 175 'EventUsrEnterBootMode2': '0x4094', 176 'EventUsrChargerConnected': '0x4095', 177 'EventUsrChargerDisconnected': '0x4096', 178 'EventUsrSubwooferDisconnect': '0x4097', 179 'EventUsrAnalogAudioConnected': '0x4098', 180 'EventUsrAnalogAudioDisconnected': '0x4099', 181 'EventUsrGaiaDFURequest': '0x409A', 182 'EventUsrStartIRLearningMode': '0x409B', 183 'EventUsrStopIRLearningMode': '0x409C', 184 'EventUsrClearIRCodes': '0x409D', 185 'EventUsrUserEqOn': '0x409E', 186 'EventUsrUserEqOff': '0x409F', 187 'EventUsrUserEqOnOffToggle': '0x40A0', 188 'EventUsrSpdifAudioConnected': '0x40AD', 189 'EventUsrSpdifAudioDisconnected': '0x40AE', 190 'EventUsrSelectAudioSourceSpdif': '0x40AF', 191 'EventUsrChangeAudioRouting': '0x40B0', 192 'EventUsrMasterDeviceTrimVolumeUp': '0x40B1', 193 'EventUsrMasterDeviceTrimVolumeDown': '0x40B2', 194 'EventUsrSlaveDeviceTrimVolumeUp': '0x40B3', 195 'EventUsrSlaveDeviceTrimVolumeDown': '0x40B4', 196 'EventUsrEstablishPeerConnection': '0x40B5', 197 'EventUsrTwsQualificationEnablePeerOpen': '0x40B7', 198 'EventUsrBleStartBonding': '0x40D0', 199 'EventUsrBleSwitchPeripheral': '0x40D1', 200 'EventUsrBleSwitchCentral': '0x40D2', 201 'EventUsrImmAlertStop': '0x40D3', 202 'EventUsrLlsAlertStop': '0x40D4', 203 'EventUsrFindMyRemoteImmAlertMild': '0x40D5', 204 'EventUsrFindMyRemoteImmAlertHigh': '0x40D6', 205 'EventUsrFindMyPhoneImmAlertMild': '0x40D7', 206 'EventUsrFindMyPhoneImmAlertHigh': '0x40D8', 207 'EventUsrFindMyPhoneRemoteImmAlertHigh': '0x40D9', 208 'EventUsrPartyModeOn': '0x40DA', 209 'EventUsrPartyModeOff': '0x40DB', 210 'EventUsrBleDeleteDevice': '0x40EC', 211 'EventUsrAvrcpNextGroupRelease': '0x40ED', 212 'EventUsrAvrcpPreviousGroupRelease': '0x40EE', 213 'EventUsrTwsQualificationVolUp': '0x40EF', 214 'EventUsrTwsQualificationVolDown': '0x40F0', 215 'EventUsrStartA2DPStream': '0x40F1', 216 'EventUsrPbapBrowseListByName': '0x40F2', 217 'EventUsrTwsQualificationSetAbsVolume': '0x40F3', 218 'EventUsrTwsQualificationPlayTrack': '0x40F4', 219 'EventUsrBleHidExtraConfig': '0x40F5', 220 'EventUsrTwsQualificationAVRCPConfigureDataSize': '0x40F6', 221} 222