BLE fixes.

This commit is contained in:
Joe Kearney 2025-06-05 20:11:10 -05:00
parent ba23026d13
commit 747e336cc1
4 changed files with 83 additions and 11 deletions

View file

@ -30,6 +30,15 @@ static void Wrapping_Up_Entry(StateMachineContext_T * context);
static void Wrapping_Up_Do(StateMachineContext_T * context);
static void Wrapping_Up_Exit(StateMachineContext_T * context);
static TimerHandle_t BLEInfoRequestResponseTimer = NULL;
static StaticTimer_t xBLEInfoRequestResponseTimerBuffer;
static TickType_t xBLEInfoRequestResponseTimerPeriod = 3000 / portTICK_PERIOD_MS;
static void BLEInfoRequestResponseTimerCallback(TimerHandle_t xTimer)
{
BLE_UpdateStatusPacket(STATE_WRAPPING_UP);
}
//! Activities for the **Wrapping Up** state.
const StateActivity_T STATE_WRAPPING_UP_Activities =
{
@ -52,6 +61,22 @@ static void Wrapping_Up_Entry(StateMachineContext_T * context)
{
KLOG_ERROR(KLOG_TAG, "Couldn't start BLE!");
}
if (BLEInfoRequestResponseTimer == NULL)
{
BLEInfoRequestResponseTimer = xTimerCreateStatic(
"BLEInfoRequestResponse",
xBLEInfoRequestResponseTimerPeriod,
pdFALSE,
(void *)0,
BLEInfoRequestResponseTimerCallback,
&xBLEInfoRequestResponseTimerBuffer);
}
if (BLEInfoRequestResponseTimer == NULL)
{
KLOG_ERROR(KLOG_TAG, "Couldn't create the BLEInfoRequestResponseTimer!");
}
}
//! Executes the Wrapping Up state.