Add a few hints about where to do what.
This commit is contained in:
parent
bca49635f3
commit
2cf035768d
1 changed files with 14 additions and 2 deletions
16
HACKING
16
HACKING
|
@ -49,5 +49,17 @@ infrastructure ready for hacking the new card support:
|
||||||
when it finds your tag;
|
when it finds your tag;
|
||||||
- Edit the freefare_free_tags() function so that it calls
|
- Edit the freefare_free_tags() function so that it calls
|
||||||
<tag>_tag_free() to free your tags;
|
<tag>_tag_free() to free your tags;
|
||||||
- Create libfreefare/<tag>.c and implement all that's missing ;-)
|
- Create libfreefare/<tag>.c and implement all that's missing:
|
||||||
|
- <tag>_tag_new() SHALL allocate all data-structure the tag may need to
|
||||||
|
use during it's lifetime. We do not want to have any function to fail
|
||||||
|
later because the running system is out of resources;
|
||||||
|
- <tag>_connect() SHOULD initialise data allocated by <tag>_tag_new().
|
||||||
|
Keep in mind that a single tag may be disconnected from and connected
|
||||||
|
to again, without being freed in the meantime. Since all memory
|
||||||
|
allocations are done in <tag>_tag_new(), your code SHOULD only care
|
||||||
|
about initialising these data structures;
|
||||||
|
- <tag>_disconnect() MAY do more that just send a disconnect command to
|
||||||
|
the tag. At time of writing I have no idea what it could be but who
|
||||||
|
knows...
|
||||||
|
- <tag>_tag_free() SHALL free all resources allocated for the tag
|
||||||
|
(surprising, isn't it?)
|
||||||
|
|
Loading…
Add table
Reference in a new issue