Guest User

Untitled

a guest
Dec 14th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. uint8_t Adafruit_Fingerprint::downloadModel(uint16_t id, uint8_t packet_1[], uint8_t packet_2[], uint8_t slot) {
  2. uint8_t packet[] = {FINGERPRINT_DOWNLOAD, slot};
  3. writePacket(theAddress, FINGERPRINT_COMMANDPACKET, sizeof(packet)+2, packet);
  4. uint8_t len = getReply(recvPacket);
  5.  
  6. if ((len != 1) && (recvPacket[0] != FINGERPRINT_ACKPACKET))
  7. return -1;
  8. if (recvPacket[1] == 0x00) {
  9. writePacket(theAddress, FINGERPRINT_DATAPACKET, sizeof(packet_1)+2, packet_1);
  10. writePacket(theAddress, FINGERPRINT_DATAPACKET, sizeof(packet_2)+2, packet_2);
  11. return recvPacket[1];
  12. } else {
  13. return recvPacket[1];
  14. }
  15. }
Add Comment
Please, Sign In to add comment