CerebusOSS / pycbsdk

Pure Python package for communicating with Blackrock Cerebus devices
MIT License
2 stars 0 forks source link

PacketHandlerThread should have an option to disable `warn_unhandled` #8

Open cboulay opened 8 months ago

cboulay commented 8 months ago

In situations where your device is sending data in multiple modalities (to Central for recording) but your pycbsdk is only interested in some of that data, currently we get lots of warnings about unhandled packets.

A current solution is to register a do-nothing callback for that packet type.

However, it would be nice if the PacketHandlerThread simply had an option to not warn about unhandled packets.

e.g., in the following: https://github.com/CerebusOSS/pycbsdk/blob/875febdefaad84a2ef51a758c5db0cf6555b0d9f/src/pycbsdk/cbhw/handler.py#L113

We could simply make that

elif b_debug_unknown and self._b_warn_unhandled:

where _b_warn_unhandled is set during thread initialization. This is set on device connection and cannot be modified while running.