Adding a New BLE Message¶
ble_commands.h¶
In the
namesnamespace, assign a name to the character you want to use.In the
commandsarray, add your new message and specify the number of variables the system should expect to receive or transmit.If your message is sent by the Exo, you’re done.
If your message is received by the Exo, navigate to the
handlersnamespace and implement the function that should run when your message is received.The function must be declared like so:
inline static void my_new_function(ExoData* data, BleMessage* msg)
ComsMCU.cpp¶
If your message is received by the Exo, open the switch statement in the function:
ComsMCU::_process_complete_gui_command(BleMessage* msg)
Add a new
casefor your message, using the variable you created in thenamesnamespace. The case should call the corresponding function in thehandlersnamespace.
Done¶
If your command is sent by the Exo, the parser recognizes and packages your data automatically.
If your command is received, the parser packages your data and calls the function defined in the
handlersnamespace.