Hi,
With the short description from source code (ke_task.h) as below:
/// Pointer to the state handler table (one element for each state).
const struct ke_state_handler* state_handler;
/// Pointer to the default state handler (element parsed after the current state).
const struct ke_state_handler* default_handler;
I still don't know exactly when 'default_handler' will be called, so to speak, what's exact meaning of 'element parsed after the current state'?
我猜应该是将被称为“default_handler”*everytime* after the handler specified in 'state_handler'. ?? Is this true?
Can someone help to explain it for me?
Device:
If there is no matching handler in the table of the current state, the default handler table will be looked up. This means you can write most of your handlers in the default state table, and override a few of them depending on the state.
Hi,
As Joacim correctly stated, default handlers handle events that the user (you) don't handle. For each event (or message) that is triggered, the call back table inuser_callback_config.hmust specify to either be handled by the default handler, behandledbya handler implemented by you (the user), or be gracefully "ignored" (NULL). This method allows the user to implement anything he/she wants without having to care about stuff that already works in the sample code. This is the core difference between SDK3 and SDK5 in fact.
Hi,
Thanks for your comment. Well noted!