MERGE: svn merge -r 19:20 trunk/src branches/portability/src
This commit is contained in:
parent
7b82eb10a0
commit
5391dfc902
3 changed files with 7 additions and 5 deletions
|
@ -29,6 +29,7 @@ typedef void* dev_spec; // Device connection specification
|
||||||
#define INVALID_DEVICE_INFO 0
|
#define INVALID_DEVICE_INFO 0
|
||||||
#define MAX_FRAME_LEN 264
|
#define MAX_FRAME_LEN 264
|
||||||
#define DEVICE_NAME_LENGTH 256
|
#define DEVICE_NAME_LENGTH 256
|
||||||
|
#define MAX_DEVICES 16
|
||||||
|
|
||||||
// Useful macros
|
// Useful macros
|
||||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
|
@ -43,7 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define ACR122_WRAP_LEN 5
|
#define ACR122_WRAP_LEN 5
|
||||||
#define ACR122_COMMAND_LEN 266
|
#define ACR122_COMMAND_LEN 266
|
||||||
#define ACR122_RESPONSE_LEN 268
|
#define ACR122_RESPONSE_LEN 268
|
||||||
#define MAX_READERS 16
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SCARDCONTEXT hCtx;
|
SCARDCONTEXT hCtx;
|
||||||
|
@ -61,8 +60,8 @@ static byte abtLed[9] = { 0xFF,0x00,0x40,0x05,0x04,0x00,0x00,0x00,0x00 };
|
||||||
|
|
||||||
dev_info* dev_acr122_connect(const uint32_t uiIndex)
|
dev_info* dev_acr122_connect(const uint32_t uiIndex)
|
||||||
{
|
{
|
||||||
char* pacReaders[MAX_READERS];
|
char* pacReaders[MAX_DEVICES];
|
||||||
char acList[256+64*MAX_READERS];
|
char acList[256+64*MAX_DEVICES];
|
||||||
size_t ulListLen = sizeof(acList);
|
size_t ulListLen = sizeof(acList);
|
||||||
uint32_t uiPos;
|
uint32_t uiPos;
|
||||||
uint32_t uiReaderCount;
|
uint32_t uiReaderCount;
|
||||||
|
@ -92,7 +91,7 @@ dev_info* dev_acr122_connect(const uint32_t uiIndex)
|
||||||
for (uiPos=0; uiPos<ulListLen; uiPos++)
|
for (uiPos=0; uiPos<ulListLen; uiPos++)
|
||||||
{
|
{
|
||||||
// Make sure don't break out of our reader array
|
// Make sure don't break out of our reader array
|
||||||
if (uiReaderCount == MAX_READERS) break;
|
if (uiReaderCount == MAX_DEVICES) break;
|
||||||
|
|
||||||
// Test if there is a next reader available
|
// Test if there is a next reader available
|
||||||
if (acList[uiPos] == 0x00)
|
if (acList[uiPos] == 0x00)
|
||||||
|
|
|
@ -25,11 +25,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "dev_acr122.h"
|
#include "dev_acr122.h"
|
||||||
#include "dev_pn531.h"
|
#include "dev_pn531.h"
|
||||||
|
#include "dev_arygon.h"
|
||||||
|
|
||||||
const static struct dev_callbacks dev_callbacks_list[] = {
|
const static struct dev_callbacks dev_callbacks_list[] = {
|
||||||
// Driver Name Connect Transceive Disconect
|
// Driver Name Connect Transceive Disconect
|
||||||
{ "ACR122", dev_acr122_connect, dev_acr122_transceive, dev_acr122_disconnect },
|
{ "ACR122", dev_acr122_connect, dev_acr122_transceive, dev_acr122_disconnect },
|
||||||
{ "PN531USB", dev_pn531_connect, dev_pn531_transceive, dev_pn531_disconnect }
|
{ "PN531USB", dev_pn531_connect, dev_pn531_transceive, dev_pn531_disconnect },
|
||||||
|
{ "ARYGON", dev_arygon_connect, dev_arygon_transceive, dev_arygon_disconnect }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _LIBNFC_DEVICES_H_
|
#endif // _LIBNFC_DEVICES_H_
|
||||||
|
|
Loading…
Add table
Reference in a new issue