From e03414ce6d96c3acdc6bb56be59c50fb6a1721fc Mon Sep 17 00:00:00 2001 From: Dāvis Mošenkovs Date: Wed, 3 Sep 2025 21:50:13 +0300 Subject: Setting to disable DFU and FS access (#1891) * Expose SystemTask dependency controllers Expose NotificationManager and Settings for use by the feature in next commit. This is a memory efficient way for accessing SystemTask dependencies from controllers that have SystemTask injected as a dependency. Looks like each direct dependency injection uses 4 bytes RAM. As InfiniTime is close to running out of RAM (using 16 more bytes causes build to fail with "ld: region RAM overflowed with stack") it might be helpful to use this approach more. * Add setting to disable DFU and FS access --- src/components/ble/FSService.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/components/ble/FSService.h') diff --git a/src/components/ble/FSService.h b/src/components/ble/FSService.h index b2299623..b43bc9e4 100644 --- a/src/components/ble/FSService.h +++ b/src/components/ble/FSService.h @@ -14,6 +14,8 @@ namespace Pinetime { namespace Controllers { class Ble; + class Settings; + class NotificationManager; class FSService { public: @@ -26,6 +28,10 @@ namespace Pinetime { private: Pinetime::System::SystemTask& systemTask; Pinetime::Controllers::FS& fs; + + static constexpr const char denyAlert[] = "InfiniTime\0File access attempted, but disabled in settings."; + static constexpr const uint8_t denyAlertLength = sizeof(denyAlert); // for this to work denyAlert MUST be array + static constexpr uint16_t FSServiceId {0xFEBB}; static constexpr uint16_t fsVersionId {0x0100}; static constexpr uint16_t fsTransferId {0x0200}; -- cgit v1.2.3-70-g09d2