Skip to content

more sane callbacks #12

@petervaro

Description

@petervaro
  • Sensors like LED and alike should not have any callbacks (like it has on_off now), but only direct controllers (like the off method).
  • on_activate should also be provided by Context instead the Manager only => it should be similar to the one that Manager provides, except that the Manager based callback passes the "current" and the "next" Context objects as arguments, while this one should pass "self" (the "next" Context) only;
  • on_deactivate => similar to the previous one, except that, this is called when a Context is being switched to another one, but also provides access to "self" (the "current" Context);
  • on_start, on_stop, on_cycle_begin and on_cycle_end => the only difference between the callbacks of the same name that Manager provides, is the argument order and the fact that, these functions will only be called if the bound Context is the currently active one.
    • kb_Error(*on_start)(kb_Manager *const self, kb_rpi2_Context *const active);
    • kb_Error(*on_start)(kb_rpi2_Context *const self, kb_Manager *const manager);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions