Skip to content

Pass some context to user-supplied interrupt callback #82

@randomir

Description

@randomir

Currently, the interrupt callback function is called after each sample (read), but it receives no context, like last sample or energy. Furthermore, it's not even possible to capture references to sample/energy arrays in closure because they are created in cython code and returned to python on the very end of sampling (i.e. after interrupted).

So, providing references to sample/energy numpy arrays (semi-filled) on each call of interrupt callback would enable user to stop sampling when energy threshold is reached, for example.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions