Skip to content

Commit 847b200

Browse files
committed
Remove sim MotionService.h copy and use InfiniTime verison instead
1 parent c7e512a commit 847b200

12 files changed

Lines changed: 352 additions & 176 deletions

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@ add_library(sim-base STATIC
8888
# nrf/components/libraries/timer
8989
sim/libraries/gpiote/app_gpiote.h # includes hal/nrf_gpio.h
9090
# nibmle
91+
sim/host/ble_att.h
9192
sim/host/ble_gap.h
9293
sim/host/ble_gatt.h
9394
sim/host/ble_gatt.cpp
95+
sim/host/ble_hs_mbuf.h
96+
sim/host/ble_hs_mbuf.cpp
9497
sim/host/ble_uuid.h
9598
sim/host/ble_uuid.cpp
9699
sim/host/os_mbuf.h
@@ -128,8 +131,6 @@ target_sources(infinisim PUBLIC
128131
sim/components/battery/BatteryController.cpp
129132
sim/components/ble/AlertNotificationService.h
130133
sim/components/ble/AlertNotificationService.cpp
131-
sim/components/ble/MotionService.h
132-
sim/components/ble/MotionService.cpp
133134
sim/components/ble/MusicService.h
134135
sim/components/ble/MusicService.cpp
135136
sim/components/ble/NimbleController.h
@@ -198,6 +199,8 @@ target_sources(infinisim PUBLIC
198199
${InfiniTime_DIR}/src/components/datetime/DateTimeController.cpp
199200
${InfiniTime_DIR}/src/components/settings/Settings.h
200201
${InfiniTime_DIR}/src/components/settings/Settings.cpp
202+
${InfiniTime_DIR}/src/components/ble/MotionService.h
203+
${InfiniTime_DIR}/src/components/ble/MotionService.cpp
201204
${InfiniTime_DIR}/src/components/ble/NavigationService.h
202205
${InfiniTime_DIR}/src/components/ble/NavigationService.cpp
203206
${InfiniTime_DIR}/src/components/ble/NotificationManager.h

sim/components/ble/MotionService.cpp

Lines changed: 0 additions & 126 deletions
This file was deleted.

sim/components/ble/MotionService.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

sim/components/ble/NimbleController.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ void NimbleController::StartDiscovery() {
365365
// }
366366
}
367367

368-
//uint16_t NimbleController::connHandle() {
369-
// return connectionHandle;
370-
//}
368+
uint16_t NimbleController::connHandle() {
369+
return connectionHandle;
370+
}
371371

372372
void NimbleController::NotifyBatteryLevel(uint8_t level) {
373373
// if (connectionHandle != BLE_HS_CONN_HANDLE_NONE) {

sim/components/ble/NimbleController.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
#include <cstdint>
44

5-
//#define min // workaround: nimble's min/max macros conflict with libstdc++
6-
//#define max
7-
//#include <host/ble_gap.h>
8-
//#undef max
9-
//#undef min
5+
#define min // workaround: nimble's min/max macros conflict with libstdc++
6+
#define max
7+
#include <host/ble_gap.h>
8+
#undef max
9+
#undef min
1010
//#include "components/ble/AlertNotificationClient.h"
1111
#include "components/ble/AlertNotificationService.h"
1212
//#include "components/ble/BatteryInformationService.h"
@@ -121,7 +121,7 @@ namespace Pinetime {
121121
// ServiceDiscovery serviceDiscovery;
122122

123123
uint8_t addrType;
124-
// uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;
124+
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;
125125
uint8_t fastAdvCount = 0;
126126
uint8_t bondId[16] = {0};
127127

0 commit comments

Comments
 (0)