aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ble/NimbleController.h
diff options
context:
space:
mode:
authorKieran Cawthray <kieranc@gmail.com>2021-12-09 22:41:29 +0100
committerKieran Cawthray <kieranc@gmail.com>2021-12-09 22:41:29 +0100
commit6cf4a933b6323fc24a3b27ae55a3c12d31d6a841 (patch)
treeffee2e59a62efe62aa8255f68e7cc89be1cad152 /src/components/ble/NimbleController.h
parentae4b9e0f2e877d200bd780f99e2a8952f9f8bf5b (diff)
parent42a5cdb5b776c2cdeb08a8c6f26606282a809178 (diff)
Merge remote-tracking branch 'upstream/develop' into pts-settings
Diffstat (limited to 'src/components/ble/NimbleController.h')
-rw-r--r--src/components/ble/NimbleController.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h
index 895b87f2..12bd6924 100644
--- a/src/components/ble/NimbleController.h
+++ b/src/components/ble/NimbleController.h
@@ -14,12 +14,14 @@
#include "components/ble/CurrentTimeService.h"
#include "components/ble/DeviceInformationService.h"
#include "components/ble/DfuService.h"
+#include "components/ble/HeartRateService.h"
#include "components/ble/ImmediateAlertService.h"
#include "components/ble/MusicService.h"
#include "components/ble/NavigationService.h"
#include "components/ble/ServiceDiscovery.h"
-#include "components/ble/HeartRateService.h"
#include "components/ble/MotionService.h"
+#include "components/ble/weather/WeatherService.h"
+#include "components/fs/FS.h"
namespace Pinetime {
namespace Drivers {
@@ -45,7 +47,8 @@ namespace Pinetime {
Controllers::Battery& batteryController,
Pinetime::Drivers::SpiNorFlash& spiNorFlash,
Controllers::HeartRateController& heartRateController,
- Controllers::MotionController& motionController);
+ Controllers::MotionController& motionController,
+ Pinetime::Controllers::FS& fs);
void Init();
void StartAdvertising();
int OnGAPEvent(ble_gap_event* event);
@@ -70,6 +73,9 @@ namespace Pinetime {
Pinetime::Controllers::AlertNotificationService& alertService() {
return anService;
};
+ Pinetime::Controllers::WeatherService& weather() {
+ return weatherService;
+ };
uint16_t connHandle();
void NotifyBatteryLevel(uint8_t level);
@@ -79,12 +85,16 @@ namespace Pinetime {
}
private:
+ void PersistBond(struct ble_gap_conn_desc& desc);
+ void RestoreBond();
+
static constexpr const char* deviceName = "InfiniTime";
Pinetime::System::SystemTask& systemTask;
Pinetime::Controllers::Ble& bleController;
DateTime& dateTimeController;
Pinetime::Controllers::NotificationManager& notificationManager;
Pinetime::Drivers::SpiNorFlash& spiNorFlash;
+ Pinetime::Controllers::FS& fs;
Pinetime::Controllers::DfuService dfuService;
DeviceInformationService deviceInformationService;
@@ -93,23 +103,24 @@ namespace Pinetime {
AlertNotificationClient alertNotificationClient;
CurrentTimeService currentTimeService;
MusicService musicService;
+ WeatherService weatherService;
NavigationService navService;
BatteryInformationService batteryInformationService;
ImmediateAlertService immediateAlertService;
HeartRateService heartRateService;
MotionService motionService;
+ ServiceDiscovery serviceDiscovery;
- uint8_t addrType; // 1 = Random, 0 = PUBLIC
+ uint8_t addrType;
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;
uint8_t fastAdvCount = 0;
+ uint8_t bondId[16] = {0};
ble_uuid128_t dfuServiceUuid {
.u {.type = BLE_UUID_TYPE_128},
.value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, 0xDE, 0xEF, 0x12, 0x12, 0x30, 0x15, 0x00, 0x00}};
-
- ServiceDiscovery serviceDiscovery;
};
- static NimbleController* nptr;
+ static NimbleController* nptr;
}
}