diff options
Diffstat (limited to 'src/components/ble/NimbleController.h')
-rw-r--r-- | src/components/ble/NimbleController.h | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h index 6c409740..000231fe 100644 --- a/src/components/ble/NimbleController.h +++ b/src/components/ble/NimbleController.h @@ -14,6 +14,7 @@ #include "components/ble/CurrentTimeService.h" #include "components/ble/DeviceInformationService.h" #include "components/ble/DfuService.h" +#include "components/ble/FSService.h" #include "components/ble/HeartRateService.h" #include "components/ble/ImmediateAlertService.h" #include "components/ble/MusicService.h" @@ -22,7 +23,6 @@ #include "components/ble/MotionService.h" #include "components/ble/weather/WeatherService.h" #include "components/fs/FS.h" -#include "components/ble/FSService.h" namespace Pinetime { namespace Drivers { @@ -42,27 +42,17 @@ namespace Pinetime { public: NimbleController(Pinetime::System::SystemTask& systemTask, - Pinetime::Controllers::Ble& bleController, + Ble& bleController, DateTime& dateTimeController, - Pinetime::Controllers::NotificationManager& notificationManager, - Controllers::Battery& batteryController, + NotificationManager& notificationManager, + Battery& batteryController, Pinetime::Drivers::SpiNorFlash& spiNorFlash, - Controllers::HeartRateController& heartRateController, - Controllers::MotionController& motionController, - Pinetime::Controllers::FS& fs); + HeartRateController& heartRateController, + MotionController& motionController, + FS& fs); void Init(); void StartAdvertising(); int OnGAPEvent(ble_gap_event* event); - - int OnDiscoveryEvent(uint16_t i, const ble_gatt_error* pError, const ble_gatt_svc* pSvc); - int OnCTSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_chr* characteristic); - int OnANSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_chr* characteristic); - int OnCurrentTimeReadResult(uint16_t connectionHandle, const ble_gatt_error* error, ble_gatt_attr* attribute); - int OnANSDescriptorDiscoveryEventCallback(uint16_t connectionHandle, - const ble_gatt_error* error, - uint16_t characteristicValueHandle, - const ble_gatt_dsc* descriptor); - void StartDiscovery(); Pinetime::Controllers::MusicService& music() { @@ -83,7 +73,10 @@ namespace Pinetime { void RestartFastAdv() { fastAdvCount = 0; - } + }; + + void EnableRadio(); + void DisableRadio(); private: void PersistBond(struct ble_gap_conn_desc& desc); @@ -91,11 +84,11 @@ namespace Pinetime { static constexpr const char* deviceName = "InfiniTime"; Pinetime::System::SystemTask& systemTask; - Pinetime::Controllers::Ble& bleController; + Ble& bleController; DateTime& dateTimeController; Pinetime::Drivers::SpiNorFlash& spiNorFlash; - Pinetime::Controllers::FS& fs; - Pinetime::Controllers::DfuService dfuService; + FS& fs; + DfuService dfuService; DeviceInformationService deviceInformationService; CurrentTimeClient currentTimeClient; |