mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-12-21 00:31:46 +03:00
Revert "Linear decrease of advert rate to conserve battery"
This reverts commit c32ba844e0
.
This commit is contained in:
parent
c32ba844e0
commit
4820b2ffe8
@ -122,8 +122,6 @@ void NimbleController::StartAdvertising() {
|
|||||||
|
|
||||||
adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
|
adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
|
||||||
adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
|
adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
|
||||||
adv_params.itvl_min = advInterval;
|
|
||||||
adv_params.itvl_max = advInterval + 100;
|
|
||||||
|
|
||||||
fields.flags = BLE_HS_ADV_F_DISC_GEN | BLE_HS_ADV_F_BREDR_UNSUP;
|
fields.flags = BLE_HS_ADV_F_DISC_GEN | BLE_HS_ADV_F_BREDR_UNSUP;
|
||||||
fields.uuids128 = &dfuServiceUuid;
|
fields.uuids128 = &dfuServiceUuid;
|
||||||
@ -150,8 +148,6 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
|
|||||||
case BLE_GAP_EVENT_ADV_COMPLETE:
|
case BLE_GAP_EVENT_ADV_COMPLETE:
|
||||||
NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE");
|
NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE");
|
||||||
NRF_LOG_INFO("reason=%d; status=%d", event->adv_complete.reason, event->connect.status);
|
NRF_LOG_INFO("reason=%d; status=%d", event->adv_complete.reason, event->connect.status);
|
||||||
if (advInterval < 7100)
|
|
||||||
advInterval += 500;
|
|
||||||
StartAdvertising();
|
StartAdvertising();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -185,7 +181,6 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
|
|||||||
alertNotificationClient.Reset();
|
alertNotificationClient.Reset();
|
||||||
connectionHandle = BLE_HS_CONN_HANDLE_NONE;
|
connectionHandle = BLE_HS_CONN_HANDLE_NONE;
|
||||||
bleController.Disconnect();
|
bleController.Disconnect();
|
||||||
advInterval = 100;
|
|
||||||
StartAdvertising();
|
StartAdvertising();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -94,7 +94,6 @@ namespace Pinetime {
|
|||||||
|
|
||||||
uint8_t addrType; // 1 = Random, 0 = PUBLIC
|
uint8_t addrType; // 1 = Random, 0 = PUBLIC
|
||||||
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;
|
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;
|
||||||
uint16_t advInterval = 100; // multiplied by 0.625ms, must be in 32..16384
|
|
||||||
|
|
||||||
ble_uuid128_t dfuServiceUuid {
|
ble_uuid128_t dfuServiceUuid {
|
||||||
.u {.type = BLE_UUID_TYPE_128},
|
.u {.type = BLE_UUID_TYPE_128},
|
||||||
|
Loading…
Reference in New Issue
Block a user