FREEFARE_ERROR(3)
π NAME π
okay bestie, so this page is all about the error-reporting girlies in the freefare crew β we're talking freefare_strerror, freefare_strerror_r, freefare_perror, and mifare_desfire_last_picc_error. they are literally the Error Reporting Functions, and they exist so you're never just staring at a card going "why are you like this π". this is FREEFARE_ERROR(3) from the Library Functions Manual, and she's here to translate card drama into actual words.
π LIBRARY π
she lives in the Mifare card manipulation library, aka libfreefare, and you link her with -lfreefare. that's the whole vibe.
β¨ SYNOPSIS β¨
#include <freefare.h>
const char *
freefare_strerror(MifareTag tag);
int
freefare_strerror_r(MifareTag tag, char *buffer, size_t len);
void
freefare_strerror(MifareTag tag, char *string);
uint8_t
mifare_desfire_last_pcd_error(MifareTag tag);
uint8_t
mifare_desfire_last_picc_error(MifareTag tag);
yes bestie, the third one really does say freefare_strerror in there. that's what the page says, so that's what you get. i don't make the rules, i just deliver them with sparkle β¨
π¦ DESCRIPTION π¦
the freefare_strerror() functions return the error string that matches the last PCD or PICC error that happened while using tag. it's giving "translator for card feelings", and honestly? iconic.
the freefare_strerror_r() function does the same thing as freefare_strerror(), except the error message gets copied into buffer, and the absolute max size it'll write is len chars. so like, bring your own buffer, bestie. len is the ceiling, no cap π§’.
the freefare_strerror() function prints the last PCD or PICC error that happened with tag straight to stderr. it doesn't return the string, it just yells it into the void for you. very main character energy.
the mifare_desfire_last_pcd_error() function returns the error code of the last function call from the library. so the library's most recent oopsie, quantified. π
the mifare_desfire_last_picc_error() function returns the error code that tag handed back from the last command that ran on it. the card's own little confession, fr fr.
πΈ RETURN VALUES πΈ
freefare_strerror()returns the error message. that's it, that's the tea.freefare_strerror_r()returns0on success,-1on failure.mifare_desfire_last_pcd_error()andmifare_desfire_last_picc_error()return an error code β or0if no error occurred, or iftagis not a Mifare DESFire target.
so if you're getting 0 back and going "but something's wrong??", check whether tag is even a Mifare DESFire target first, bestie. she said "not my department" π
π SEE ALSO π
π AUTHORS π
Romain Tartiere <romain@il4p.org> β the one who wrote her, we stan. π«Ά
and that's a wrap on the FREEFARE_ERROR(3) page, brought to you by the Debian crew, dated September 28, 2010, version FREEFARE_ERROR(3). she's an oldie but a goodie and she ate, no notes. mwah πβ¨
π¦ where this page comes from
- debian bookworm: libfreefare-doc 0.4.0-2.1 Β· LGPL-3.0-or-later
- debian trixie: libfreefare-doc 0.4.0-2.3 Β· LGPL-3.0-or-later
- nixos 26.05: libfreefare 0.4.0
- nixpkgs unstable: libfreefare 0.4.0
- ubuntu jammy: libfreefare-doc 0.4.0-2.1build1 Β· LGPL-3.0-or-later
- ubuntu noble: libfreefare-doc 0.4.0-2.3build2 Β· LGPL-3.0-or-later
- ubuntu questing: libfreefare-doc 0.4.0-2.3build2
- ubuntu resolute: libfreefare-doc 0.4.0-2.3build3 Β· LGPL-3.0-or-later
- ubuntu stonking: libfreefare-doc 0.4.0-2.4build1 Β· LGPL-3.0-or-later
- Copyright (C) 2010 Romain Tartiere
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms