Closed DrNickDMartin closed 6 years ago
Hi @DrNickDMartin, this is a shortcoming introduced when we switched to the generic SWIG interface files for the UPM modules. Enums and defines don't get picked up as constants in the SWIG generated wrapper if they are defined in a C header rather than a CPP one. @pylbert is working on a fix for it, thanks for pointing it out.
@DrNickDMartin, @Propanu, the pyupm_rsc module now exposes types from rsc_regs.h. I added syntax to the python example which accesses these types. While this code is non-functional (as far as the example is concerned), it would fail CI if these types are not exposed in the future.
These can be used like so:
I've been able to build and interact with my Honeywell RSC sensor using UPM (it's fantastic!). I've been using the Python bindings but I've run into a stumbling block.
I'm trying to set the mode and data rate for the sensor using the following:
However, I'm not sure how to access the
RSC_MODE
andRSC_DATA_RATE
enums from the source code in when using Python. If I try passing an int to the function then I get aTypeError
.Any ideas?