Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */
| 71 | |
| 72 | /** Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */ |
| 73 | std::shared_ptr<I2cScannerApp> optApp() { |
| 74 | auto appContext = getCurrentAppContext(); |
| 75 | if (appContext != nullptr && appContext->getManifest().appId == manifest.appId) { |
| 76 | return std::static_pointer_cast<I2cScannerApp>(appContext->getApp()); |
| 77 | } else { |
| 78 | return nullptr; |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | #define PREFERENCES_BUS_INDEX_KEY "bus" |
| 83 |
nothing calls this directly
no test coverage detected