timmerk / libnfc

Automatically exported from code.google.com/p/libnfc
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Provide hook for registering custom drivers #225

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From the forum: http://www.libnfc.org/community/post/4166/#p4166
By lego
I am working on a project where I want to use libnfc in environment where none 
of the drivers can be used to communicate with the PN532 chip. I have 
implemented a custom driver (bus actually) to do that, but I find it not very 
flexible to statically link in all the supported drivers.  It is also not very 
sustainable because this driver probably is only useful to my project - this 
means that it will never be merged into libnfc, and if a miracle happened, 
someone would have to take the burden of maintaining it. For this reason I 
propose adding a function to the API:
int nfc_register_driver(nfc_driver* pnd);
I can't think of a useful use case for un-registering a driver though, but it 
wouldn't be too difficult to add
The fixed size array could then be replaced with a linked list.
Is there any interest in such feature? If so, I would be happy to contribute a 
patch.

Original issue reported on code.google.com by yob...@gmail.com on 31 Jan 2013 at 3:56

GoogleCodeExporter commented 9 years ago
See also issue 137

Original comment by yob...@gmail.com on 31 Jan 2013 at 9:50

GoogleCodeExporter commented 9 years ago
I have implemented function nfc_register_driver which allows this 
functionality. You can find the patch at the following URL (would appreciate a 
review) 
https://code.google.com/r/ahtilegonkov-issue-137/source/detail?r=225094e2c8d298e
43cabcc904712fe079c8e1bbb&name=issue-137

I have tested this change with the utilities, and they all were able to find 
correct driver like before the change.

Original comment by ahti.legonkov on 1 Feb 2013 at 1:01

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 73992041b420.

Original comment by yob...@gmail.com on 6 Feb 2013 at 2:09