Open fredrike opened 4 years ago
We could use the code from https://github.com/merbanan/rtl_433/blame/master/src/devices/ikea_sparsnas.c (it is quite clean). Perhaps @merbanan can help with that (would be really nice to "borrow" his sensor bruteforce part.
@slundell is the original author. But you are free to use the code under the gplv2 license, if you need another license you have to ask the original author.
Looks like a good idea. Why don't make a test branch that uses @merbanans code?
Looks like a good idea. Why don't make a test branch that uses @merbanans code?
I'll take a look at this after vacation time (perhaps even in November 😄). I need to solder a dev unit as I've actually moved to production now.
It's been bugging me the whole day yesterday and I think the sparsnäs decoding should be extracted to a separate class. This will enable easy access to multiple sensors like @Sperra suggested and also much cleaner code base.
My suggestion is that we move most parts of
interruptHandler()
into a class like this one:This means that https://github.com/fredrike/EspSparsnasGateway/blob/ce54c56d7d22fca426e0615b3bc3ebdf0c01dba9/src/RFM69functions.cpp#L315-L464 can be replaced with (and that the Sparsnas class can be reused in other projects):
We might need to add some fancy handling of LEDs and such (in my example above), the class should be native c++ but this is a base :).