Adding a New BLE Message¶
ble_commands.h¶
In the
ble_namesnamespace, assign a name to the character you want to use.In the
commandsarray within theblenamespace, add your new message name 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
ble_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, locate 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 theble_namesnamespace. The case should call the corresponding function in theble_handlersnamespace.
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
ble_handlersnamespace.Note: You may have to update the GUI to interface with the newly added BLEMessage, refer to GUI documentation if needed.