Question on implementation for new ELAN MoC sensor
Hi everyone, I reverse-engineered the ELAN 04f3:0c4c match-on-chip fingerprint sensor and I'd like to contribute it to libfprint.
This sensor has some similarities to the currently supported 04f3:0c7e sensor (elanmoc.{c,h}
). However, there some differences:
- Different commit/delete commands user data size
- Different logic for re-enrollment detection
- No calibration (AFAIK)
- No delete all command (AFAIK) (must query all fingerprints and delete those that are set, potentially requiring a valid finger verification if the sensor was idle)
- Delete requires resending all user data and remembering the finger ID - Windows remembers its own fingers' data and only deletes the fingers it enrolled
- Different (but otherwise functionally identical) verify finger command
- Different "get finger user data" command
Listed like this it looks like quite a few differences, but in reality they do have similarities.
With that said, here's my question: I could either
- start from scratch and add a completely separate implementation
- which seems to be a popular solution looking at the existing drivers
- add many if/else and add it to the current
elanmoc
- (then add some Parmesan to the resulting spaghetti)
- refactor/rewrite
elanmoc
to better support multiple similar models (though I don't have a 0c7e to test if I break it)- I don't have a plan on how to do this exactly, though. Maybe define static arrays of commands for equivalent but different commands?
All options work for me, some feedback from the maintainers and/or the current dev of the elanmoc
driver would be helpful so I can avoid unnecessary rewrites.