Minor tweaks.

- Improve code lisibility;
- Add reference document link.
This commit is contained in:
Romain Tartiere 2010-09-03 13:18:08 +00:00
parent bb840dccaf
commit 03bd356bd4

View file

@ -16,6 +16,10 @@
* *
* $Id$ * $Id$
*/ */
/*
* http://www.scnf.org.uk/smartstore/LASSeO%20docs/DESFIRE%20Specification%20V1%200.pdf
*/
#include "config.h" #include "config.h"
#if defined(HAVE_SYS_TYPES_H) #if defined(HAVE_SYS_TYPES_H)
@ -58,11 +62,11 @@ mifare_desfire_aid_new (uint32_t aid)
return res; return res;
} }
// XXX This function ease the MifareDESFireAID creation using a Mifare Classic AID (see MIFARE Application Directory document - section 3.10 MAD and MIFARE DESFire) // This function ease the MifareDESFireAID creation using a Mifare Classic AID (see MIFARE Application Directory document - section 3.10 MAD and MIFARE DESFire)
MifareDESFireAID MifareDESFireAID
mifare_desfire_aid_new_with_mad_aid (MadAid mad_aid, uint8_t n) mifare_desfire_aid_new_with_mad_aid (MadAid mad_aid, uint8_t n)
{ {
if (n > 0xf) if (n > 0x0f)
return errno = EINVAL, NULL; return errno = EINVAL, NULL;
return mifare_desfire_aid_new (0xf00000 | (mad_aid.function_cluster_code << 12) | (mad_aid.application_code << 4) | n); return mifare_desfire_aid_new (0xf00000 | (mad_aid.function_cluster_code << 12) | (mad_aid.application_code << 4) | n);