Expand description
hzgrow-r502 is an embedded-hal driver for the HZ Grow R502 (and likely similar) fingerprint module.
This is a work in progress and does not strive to meet all use cases of the device. However, it should cover the basics, and may possibly become a basis for other drivers for HZ Grow and similar modules, provided that the suppliers of those use a rougly similar API.
§Basics
See the commands implemented by the driver in Command.
Response types are all linked from Reply.
§Example
To authenticate with the R502:
use hzgrow_r502::{R502, Command, Reply};
// Obtain tx, rx from some serial port implementation
let mut r502 = R502::new(tx, rx, 0xffffffff);
match r502.send_command(Command::VfyPwd { password: 0x00000000 }) {
Ok(Reply::VfyPwd(result)) => println!("Status: {:#?}", result.confirmation_code),
Err(error) => panic!("Error: {:#?}", error),
_ => {},
}For more examples, see the examples directory.
Structs§
- Delet
Char Result - Result of deleting a fingerprint template.
- GenImg
Result - Result struct for the
GenImgcall - Img2
TzResult - Result struct for the
Img2Tzstruct - Load
Char Result - Structure containing the status code of the
LoadCharcall - Match
Result - Structure containing the status code of the
Matchcall - R502
- Represents a R502 device connected to a U(S)ART.
- Read
SysPara Result - Result struct for the
ReadSysParacall - RegModel
Result - Result of generating the fingerprint template for enrollment.
- Search
Result - Result struct for the
Searchcall - Store
Result - Result of storing a fingerprint template.
- System
Parameters - System status and configuration.
- Template
NumResult - Contains the next available template number, or index in the library at which a fingerprint can be enrolled.
- VfyPwd
Result - Result struct for the
VfyPwdcall
Enums§
- Command
- Commands that one can send to the R502.
- Delet
Char Status DeletCharstatus code- Error
- Error type for low-level R502 operations. Wraps transport-level errors as well.
- GenImg
Status - Enum for the
GenImgstatus code - Img2
TzStatus - Enum for the
Img2Tzstatus code - Load
Char Status LoadCharstatus code- Match
Status Matchstatus code- Password
Verification State - Enum for the password handshake result
- RegModel
Status RegModelstatus code- Reply
- Responses to commands returned by the R502. Names are the same as commands.
- Search
Status - Enum for the
Searchstatus code - Store
Status Storestatus code- Template
NumStatus TemplateNumstatus code