ade-ma / LibRedio

DSP abstractions
GNU General Public License v3.0
24 stars 2 forks source link

hardcoded protocol definitions in unpackers.rs #2

Closed itdaniher closed 10 years ago

itdaniher commented 10 years ago

The individual temperature & humidity sensor protocol definitions are hardcoded in unpackers.rs. This limits adaptability and flexibility, requiring a recompile to improve decoding. Moving to a declarative protocol definition (json?) would greatly improve flexibility.

itdaniher commented 10 years ago

goal advanced by addition of 'packetizer' at https://github.com/ade-ma/LibRedio/commit/4d4b3fc61ba8f87f157438ccdb4a3e428082ed0e#diff-319d2ea6763ef921136fd296bcecc7dcR173

itdaniher commented 10 years ago

I think a decoder may consist of all or some of a flowgraph and a declarative packet format definition. I'm not sure what the best avenue for packing / unpacking / definition is atm - capnp could possibly be shanghai'd into working, and some sort of [{bits: 5, name: uid, type: uint}...] json object could work.

itdaniher commented 10 years ago

With the addition of 'decoder' to kpn.rs, this is nominally resolved pending the addition of a slightly higher level function that maps a vector of uints to fields in the struct Reading.