Added BLE_StopAdvertising().

This commit is contained in:
Joe Kearney 2025-05-24 16:53:40 -05:00
parent cb72042691
commit 6382526391
4 changed files with 15 additions and 3 deletions

View file

@ -34,7 +34,8 @@ static TickType_t xBLEConfigurationResponseTimerPeriod = 3000 / portTICK_PERIOD_
static void BLEConfigurationResponseTimerCallback(TimerHandle_t xTimer)
{
BLE_UpdateHelloPacket();
// Don't send HELLO packets once configuration has started.
BLE_StopAdvertising();
}
#define MAX_MENU_DEPTH 10
@ -106,7 +107,7 @@ static void Configuring_Do(StateMachineContext_T *context)
portBASE_TYPE xStatus;
static KEvent_T Event;
// For the first hunderd milliseconds, keep updating the Hello packet, since on some platforms (PSoC6), one call is not enough.
// For the first hundred milliseconds, keep updating the Hello packet, since on some platforms (PSoC6), one call is not enough.
// TODO: Fix the Hello packet hack on PSoC6.
if ((xTaskGetTickCount() - context->Time_At_State_Entry_In_Ticks) < (100 / portTICK_PERIOD_MS))
{
@ -413,6 +414,11 @@ void HandleBLEConfigurationPacket(const BLE_ParametersPacket_T *const packet)
}
}
}
else
{
// Once configuration has begun, stop advertising the HELLO packet to free up bandwidth.
BLE_StopAdvertising();
}
BLE_FreePacketBuffer((BLE_GenericPacketType_T *)packet);
}