update
This commit is contained in:
@@ -90,6 +90,40 @@ void CFingerPrint::OnAsyncReadSystemParameters(FingerPrintIdent ident, uint8_t *
|
||||
}
|
||||
|
||||
|
||||
int CFingerPrint::AsyncSetSystemParameter(SetSystemParameterCallback fnCallback, void *pUser, uint8_t regAddr, uint8_t value)
|
||||
{
|
||||
uint8_t aPayload[] = {
|
||||
COMMAND_SETSYSPARA,
|
||||
regAddr,
|
||||
value
|
||||
};
|
||||
|
||||
m_fnRecvCallback = &CFingerPrint::OnAsyncSetSystemParameter;
|
||||
m_fnUserCallback = (void *)fnCallback;
|
||||
m_pUserData = pUser;
|
||||
|
||||
Write(IDENT_COMMAND, aPayload, sizeof(aPayload));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CFingerPrint::OnAsyncSetSystemParameter(FingerPrintIdent ident, uint8_t *pData, uint16_t length)
|
||||
{
|
||||
m_RecvState = RECV_DROP;
|
||||
|
||||
if(ident != IDENT_ACK)
|
||||
{
|
||||
((SetSystemParameterCallback)m_fnUserCallback)(m_pUserData, ERROR_COMMUNICATION, "The received packet is no ack packet!");
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t error = pData[0];
|
||||
const char *errorStr = ExplainFingerError(error);
|
||||
|
||||
((SetSystemParameterCallback)m_fnUserCallback)(m_pUserData, (FingerPrintError)error, errorStr);
|
||||
}
|
||||
|
||||
|
||||
int CFingerPrint::AsyncReadImage(ReadImageCallback fnCallback, void *pUser)
|
||||
{
|
||||
uint8_t aPayload[] = {
|
||||
|
||||
Reference in New Issue
Block a user