Reworked BLE according to v0.11 of the KTag Beacon Specification (#2)
This was done to support the new KTag Konfigurator app, which Jack created for his Senior Design project. Co-authored-by: Joe Kearney <joe@clubk.club> Reviewed-on: #2
This commit is contained in:
parent
4fe072f2d3
commit
bfcdf4c354
26 changed files with 917 additions and 128 deletions
|
@ -47,13 +47,15 @@ static void Ready_Entry(StateMachineContext_T * context)
|
|||
LOG("Entering the Ready state.");
|
||||
NeoPixelsAction_T neopixels_action = {.ID = NEOPIXELS_IDLE, .Prominence = NEOPIXELS_FOREGROUND, .Data = (void *)0x00};
|
||||
xQueueSend(xQueueNeoPixels, &neopixels_action, 0);
|
||||
BLE_UpdateStatusPacket();
|
||||
BLE_UpdateStatusPacket(STATE_READY);
|
||||
if (BLE_ScanAndAdvertise() != SYSTEMK_RESULT_SUCCESS)
|
||||
{
|
||||
KLOG_ERROR(KLOG_TAG, "Couldn't start BLE!");
|
||||
}
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_GAME_ON, .Data = (void *)0x00};
|
||||
Perform_Audio_Action(&audio_action);
|
||||
|
||||
Set_Health(Get_Max_Health());
|
||||
}
|
||||
|
||||
//! Executes the Ready state.
|
||||
|
@ -90,6 +92,10 @@ static void Ready_Do(StateMachineContext_T * context)
|
|||
{
|
||||
Transition_For_Event(context, STATE_STARTING_GAME__RESPONDING, &Event);
|
||||
}
|
||||
else if (((BLE_Packet_T *)Event.Data)->Generic.type == BLE_PACKET_TYPE_EVENT)
|
||||
{
|
||||
HandleBLEEventPacket((BLE_EventPacket_T *)Event.Data, context);
|
||||
}
|
||||
else
|
||||
{
|
||||
BLE_FreePacketBuffer(Event.Data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue