Hello!
In the simple peripheral example that comes with the latest BLE5 SDK in the "user" task there is a calling sequence initiated by simple gatt profile callback which goes like this:
SimplePeripheral_charValueChangeCB -> SimplePeripheral_enqueueMsg --??--> SimplePeripheral_processAppMsg -> SimplePeripheral_processCharValueChangeEvt
There is something similar with the clock_handler:
SimplePeripheral_clockHandler -> SimplePeripheral_enqueueMsg --??--> SimplePeripheral_processAppMsg ->SimplePeripheral_performPeriodicTask
If you have alot of timers and service callbacks this bloats the code alot. Also this adds to energy/memory footprint (probably unsignificant). Is there any other reason besides leaving the swi context asap to follow that?
Imagine having the SimplePeripheral_processCharValueChangeEvt/SimplePeripheral_performPeriodicTask code directly in the handler/callback what is the risk? Are there any benifts for using SimplePeripheral_enqueueMsg?
Best Regards