Update to nimble 1.3.0 + WIP : debug BLE connection issue with android phones.
This commit is contained in:
@@ -17,8 +17,12 @@ int AlertNotificationCallback(uint16_t conn_handle, uint16_t attr_handle, struct
|
||||
}
|
||||
|
||||
void AlertNotificationService::Init() {
|
||||
ble_gatts_count_cfg(serviceDefinition);
|
||||
ble_gatts_add_svcs(serviceDefinition);
|
||||
int res;
|
||||
res = ble_gatts_count_cfg(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
|
||||
res = ble_gatts_add_svcs(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
}
|
||||
|
||||
AlertNotificationService::AlertNotificationService ( Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::NotificationManager& notificationManager ) : m_systemTask{systemTask}, m_notificationManager{notificationManager},
|
||||
|
||||
@@ -13,8 +13,12 @@ int CTSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_acce
|
||||
}
|
||||
|
||||
void CurrentTimeService::Init() {
|
||||
ble_gatts_count_cfg(serviceDefinition);
|
||||
ble_gatts_add_svcs(serviceDefinition);
|
||||
int res;
|
||||
res = ble_gatts_count_cfg(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
|
||||
res = ble_gatts_add_svcs(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,8 +15,12 @@ int DeviceInformationCallback(uint16_t conn_handle, uint16_t attr_handle, struct
|
||||
}
|
||||
|
||||
void DeviceInformationService::Init() {
|
||||
ble_gatts_count_cfg(serviceDefinition);
|
||||
ble_gatts_add_svcs(serviceDefinition);
|
||||
int res = 0;
|
||||
res = ble_gatts_count_cfg(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
|
||||
res = ble_gatts_add_svcs(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,8 +74,12 @@ DfuService::DfuService(Pinetime::System::SystemTask &systemTask, Pinetime::Contr
|
||||
}
|
||||
|
||||
void DfuService::Init() {
|
||||
ble_gatts_count_cfg(serviceDefinition);
|
||||
ble_gatts_add_svcs(serviceDefinition);
|
||||
int res;
|
||||
res = ble_gatts_count_cfg(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
|
||||
res = ble_gatts_add_svcs(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
}
|
||||
|
||||
int DfuService::OnServiceData(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context) {
|
||||
|
||||
@@ -180,8 +180,8 @@ int NimbleController::OnGAPEvent(ble_gap_event *event) {
|
||||
StartAdvertising();
|
||||
bleController.Disconnect();
|
||||
} else {
|
||||
bleController.Connect();
|
||||
systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleConnected);
|
||||
//bleController.Connect();
|
||||
//systemTask.PushMessage(Pinetime::System::SystemTask::Messages::BleConnected);
|
||||
connectionHandle = event->connect.conn_handle;
|
||||
// Service discovery is deffered via systemtask
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user