elanmoc2 support for 0C5E
I've been playing around with the elanmoc2 driver on a HP Probook 440 G8 that uses the 0C5E
sensor and while it doesn't exactly work stock, I've managed to (with my very weak C skills lol) debug and figure out what is going on.
Basically what it appears is, the sensor is returning an extra byte at the start or something so then the check for a libfprint user ID fails.
In the elanmoc2_print_new_from_finger_info
function in elanmoc2.c
i was able to change the following:
Line 159:
memcpy(user_id, &finger_info_response[2], user_id_max_len);
works with
memcpy(user_id, &finger_info_response[3], user_id_max_len);
and
Line 164:
user_id_len = strnlen((const char *) user_id, user_id_max_len);
works with
user_id_len = strnlen((const char *) user_id, user_id_max_len - 1);
I know that the driver has been written in a way that can allow for future sensors, however my C knowledge is far too lacking to implement detection for the 0C5E sensor and adjust behaviour accordingly, but hopefully after this finding, someone with the appropriate knowledge can implement this.
Obviously to get it to work I had to set the USB product ID manually