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
|
@ -36,22 +36,21 @@
|
|||
*/
|
||||
typedef enum
|
||||
{
|
||||
STATE_DEFAULT = 0,
|
||||
STATE_INITIALIZING = 1,
|
||||
STATE_REPROGRAMMING = 2,
|
||||
STATE_CONFIGURING = 3,
|
||||
STATE_READY = 4,
|
||||
STATE_INITIALIZING = 0,
|
||||
STATE_REPROGRAMMING = 1,
|
||||
STATE_CONFIGURING = 2,
|
||||
STATE_READY = 3,
|
||||
|
||||
// Substates of STATE_STARTING_GAME
|
||||
STATE_STARTING_GAME__INSTIGATING = 5,
|
||||
STATE_STARTING_GAME__RESPONDING = 6,
|
||||
STATE_STARTING_GAME__COUNTING_DOWN = 7,
|
||||
STATE_STARTING_GAME__INSTIGATING = 4,
|
||||
STATE_STARTING_GAME__RESPONDING = 5,
|
||||
STATE_STARTING_GAME__COUNTING_DOWN = 6,
|
||||
|
||||
// Substates of STATE_PLAYING
|
||||
STATE_PLAYING__INTERACTING = 8,
|
||||
STATE_PLAYING__TAGGED_OUT = 9,
|
||||
STATE_PLAYING__INTERACTING = 7,
|
||||
STATE_PLAYING__TAGGED_OUT = 8,
|
||||
|
||||
STATE_WRAPPING_UP = 10,
|
||||
STATE_WRAPPING_UP = 9,
|
||||
|
||||
// STATE_IS_OUT_OF_RANGE is one more than the last valid state.
|
||||
STATE_IS_OUT_OF_RANGE,
|
||||
|
@ -107,6 +106,7 @@ extern TaskHandle_t State_Machine_Task_Handle;
|
|||
|
||||
void State_Machine_Task(void * pvParameters);
|
||||
void ProcessUnhandledEvent(KEvent_T * Event);
|
||||
void HandleBLEEventPacket(const BLE_EventPacket_T *const packet, StateMachineContext_T *context);
|
||||
|
||||
inline void Transition_For_Event(StateMachineContext_T* context, StateID_T next_state, KEvent_T* event)
|
||||
{
|
||||
|
@ -120,6 +120,8 @@ inline uint32_t GetTimeInState_in_ms(StateMachineContext_T * context)
|
|||
return result;
|
||||
}
|
||||
|
||||
StateMachineContext_T* GetContext();
|
||||
|
||||
#include "State_Configuring.h"
|
||||
#include "State_Ready.h"
|
||||
#include "State_Initializing.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue