Reworked BLE according to v0.12 of the KTag Beacon Specification #5

Merged
Joe merged 15 commits from BLE_Protocol_v0.12 into main 2025-09-01 17:44:10 +00:00
2 changed files with 22 additions and 0 deletions
Showing only changes of commit 620fefd355 - Show all commits

View file

@ -102,6 +102,22 @@ SystemKResult_T BLE_HandleCommonEvents(KEvent_T *event)
} }
result = SYSTEMK_RESULT_SUCCESS; result = SYSTEMK_RESULT_SUCCESS;
} }
else if (event_packet->event_ID == BLE_EVENT_FORCE_STATE)
{
uint32_t requested_state = event_packet->event_data;
if (requested_state < STATE_IS_OUT_OF_RANGE)
{
Transition_For_Event(GetContext(), (StateID_T)requested_state, event);
KLOG_INFO("BLE", "State %lu forced.", requested_state);
result = SYSTEMK_RESULT_SUCCESS;
}
else
{
KLOG_ERROR("BLE", "Attempted to force unknown state %lu.", requested_state);
result = SYSTEMK_RESULT_OVERFLOW;
}
}
} }
} }
} }

View file

@ -400,6 +400,12 @@ void HandleBLEConfigurationPacket(const BLE_ParametersPacket_T *const packet)
BLE_RespondToConfigurationPacket(packet, BLE_ERROR_CHANGING_PARAMETERS); BLE_RespondToConfigurationPacket(packet, BLE_ERROR_CHANGING_PARAMETERS);
} }
// A parameters request addressed to this device or broadcast will end a BLE Quiet.
if (BLE_Unquiet() != SYSTEMK_RESULT_SUCCESS)
{
KLOG_ERROR(KLOG_TAG, "Couldn't Unquiet to respond to a Parameters request!");
}
if (xTimerStart(BLEConfigurationResponseTimer, 0) != pdPASS) if (xTimerStart(BLEConfigurationResponseTimer, 0) != pdPASS)
{ {
KLOG_ERROR(KLOG_TAG, "Couldn't start the BLEConfigurationResponseTimer!"); KLOG_ERROR(KLOG_TAG, "Couldn't start the BLEConfigurationResponseTimer!");