| 4581 | } |
| 4582 | |
| 4583 | void runDeviceProfiling(NimBLEAddress target) { |
| 4584 | AutoCleanup cleanup([]() { BLEStateManager::deinitBLE(true); }); |
| 4585 | |
| 4586 | if (!confirmAttack("Profile device services?")) return; |
| 4587 | showAttackProgress("Profiling device...", TFT_WHITE); |
| 4588 | |
| 4589 | BLEAttackManager bleManager; |
| 4590 | DeviceProfile profile = bleManager.profileDevice(target); |
| 4591 | |
| 4592 | std::vector<String> lines; |
| 4593 | lines.push_back("DEVICE PROFILE REPORT"); |
| 4594 | lines.push_back("Address: " + profile.address); |
| 4595 | lines.push_back("Connected: " + String(profile.connected ? "YES" : "NO")); |
| 4596 | |
| 4597 | if (profile.connected) { |
| 4598 | lines.push_back("Services found: " + String(profile.services.size())); |
| 4599 | lines.push_back("FastPair: " + String(profile.hasFastPair ? "YES" : "NO")); |
| 4600 | lines.push_back("AVRCP: " + String(profile.hasAVRCP ? "YES" : "NO")); |
| 4601 | lines.push_back("HID: " + String(profile.hasHID ? "YES" : "NO")); |
| 4602 | lines.push_back("Battery: " + String(profile.hasBattery ? "YES" : "NO")); |
| 4603 | lines.push_back("Device Info: " + String(profile.hasDeviceInfo ? "YES" : "NO")); |
| 4604 | |
| 4605 | int writableCount = 0; |
| 4606 | for (auto &ch : profile.characteristics) |
| 4607 | if (ch.canWrite) writableCount++; |
| 4608 | lines.push_back("Writable chars: " + String(writableCount)); |
| 4609 | } else { |
| 4610 | lines.push_back("Failed to connect for profiling"); |
| 4611 | } |
| 4612 | |
| 4613 | cleanup.disable(); |
| 4614 | showDeviceInfoScreen("DEVICE PROFILE", lines, TFT_BLUE, TFT_WHITE); |
| 4615 | } |
| 4616 | |
| 4617 | void runWriteAccessTest(NimBLEAddress target) { |
| 4618 | AutoCleanup cleanup([]() { BLEStateManager::deinitBLE(true); }); |
no test coverage detected