Reply To: DESFireEV1 getFreeMemory() returns more available memory than getTotalMemory()

Forum MIFARE SDK DESFireEV1 getFreeMemory() returns more available memory than getTotalMemory() Reply To: DESFireEV1 getFreeMemory() returns more available memory than getTotalMemory()

Re: DESFireEV1 getFreeMemory() returns more available memory than getTotalMemory()

13. February 2017 at 11:20
Hello Francisco,

An addendum after more investigations about this issue. I can verify that the return value of getFreeMemory() directly return the native command FreMem. After discussion I got the explaination, that the real card memory is greater than the printed out value. The internal controller consumes some amount of memory and the size for the file system is only approximately the given value.

For a brand new DESFire where neither the keys nor any other memory is touched, the available memory might be slightly higher that the printed value. The method getTotalMemory() returns only the printed value without any investigation to the physical device. This method does not exist as native command.

The internal discussion is not closed yet, but I recommend you either:
1: Ignore getTotalMemory() and use always getFreeMemory() and respect what the physical device returns.
2: Or make a check in your software where you define:

int freeMemory = …
If( freeMemory <= getTotalMemory() )
{
return freeMemory;
}
else
{
return getTotalMemory();
}

Regards,
The TapLinx team
+ 0  |  - 0