summaryrefslogtreecommitdiff
path: root/src/components/ble/NimbleController.h
diff options
context:
space:
mode:
authorJames A. Jerkins <evergreen@jamesjerkinscomputer.com>2021-12-24 02:30:14 (GMT)
committerJames A. Jerkins <evergreen@jamesjerkinscomputer.com>2021-12-24 02:30:14 (GMT)
commit319030d9e16e833cf8bff569a9ecfa452165ea27 (patch)
treeae2890204710ac41fd7f637ac1c367c09f671009 /src/components/ble/NimbleController.h
parent3b0b48020d96353fc6cd114aa80fc2fec98363a3 (diff)
Add airplane mode feature
Implements 'Airplane mode' feature to disable and enable bluetooth/ble Adds airplaneMode as a non-persisted setting Adds a setting menu for switching airplane mode on and off Displays an airplane symbol on the Digital watch face and the PineTimeStyle watch face when airplane mode is enabled Always enables bluetooth/ble on boot (disable airplane mode) Alphabetizes the settings menu options Style cleanups Closes #632
Diffstat (limited to 'src/components/ble/NimbleController.h')
-rw-r--r--src/components/ble/NimbleController.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h
index 2b300e6..7219ba6 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,18 +42,19 @@ 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);
+ /* these are not implemented yet
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);
@@ -62,6 +63,7 @@ namespace Pinetime {
const ble_gatt_error* error,
uint16_t characteristicValueHandle,
const ble_gatt_dsc* descriptor);
+ */
void StartDiscovery();
@@ -83,7 +85,9 @@ namespace Pinetime {
void RestartFastAdv() {
fastAdvCount = 0;
- }
+ };
+
+ void SwitchAirplaneMode(bool enabled);
private:
void PersistBond(struct ble_gap_conn_desc& desc);
@@ -91,12 +95,12 @@ namespace Pinetime {
static constexpr const char* deviceName = "InfiniTime";
Pinetime::System::SystemTask& systemTask;
- Pinetime::Controllers::Ble& bleController;
+ Ble& bleController;
DateTime& dateTimeController;
- Pinetime::Controllers::NotificationManager& notificationManager;
+ NotificationManager& notificationManager;
Pinetime::Drivers::SpiNorFlash& spiNorFlash;
- Pinetime::Controllers::FS& fs;
- Pinetime::Controllers::DfuService dfuService;
+ FS& fs;
+ DfuService dfuService;
DeviceInformationService deviceInformationService;
CurrentTimeClient currentTimeClient;