open-ephys / liboni

API for controlling ONI-compliant hardware
https://open-ephys.github.io/onix-docs/API%20Reference/index.html
0 stars 4 forks source link

Proposed context state improvements #5

Open aacuevas opened 2 years ago

aacuevas commented 2 years ago

ONI contexts should include an INVALID state in run_state, checked as usual, set when a call to oni_init_ctx fails. This will force the destruction of any invalid context instead of enabling the possibility of calling init twice, which could result in leaks.

Adittionally, calling oni_set_opt for ONI_OPT_BLOCKREADSIZE or ONI_OPT_BLOCKWRITESIZE when run_state == RUNNING should result in an error.