summaryrefslogtreecommitdiffstats
path: root/Linux_x86/phDal4Nfc_i2c.c
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-11-07 17:37:08 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-07 17:37:08 +0000
commit644d92af6d20f9926f1f69d8320ea91271dee00b (patch)
treefa283e7ed283b12e692729a860fb51315d130d78 /Linux_x86/phDal4Nfc_i2c.c
parent7485e83289f22a0b1de660671d3a417b4cf1f6a8 (diff)
parentb99be65c277b0cc65a00a33e784ed49461531737 (diff)
downloadexternal_libnfc-nxp-644d92af6d20f9926f1f69d8320ea91271dee00b.zip
external_libnfc-nxp-644d92af6d20f9926f1f69d8320ea91271dee00b.tar.gz
external_libnfc-nxp-644d92af6d20f9926f1f69d8320ea91271dee00b.tar.bz2
am b99be65c: Use NFC HAL for some libnfc settings.
* commit 'b99be65c277b0cc65a00a33e784ed49461531737': Use NFC HAL for some libnfc settings.
Diffstat (limited to 'Linux_x86/phDal4Nfc_i2c.c')
-rw-r--r--Linux_x86/phDal4Nfc_i2c.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/Linux_x86/phDal4Nfc_i2c.c b/Linux_x86/phDal4Nfc_i2c.c
index 72da8e7..8b742d9 100644
--- a/Linux_x86/phDal4Nfc_i2c.c
+++ b/Linux_x86/phDal4Nfc_i2c.c
@@ -24,7 +24,7 @@
#define LOG_TAG "NFC_i2c"
#include <cutils/log.h>
-
+#include <hardware/nfc.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
@@ -144,24 +144,12 @@ PURPOSE: Closes the link
NFCSTATUS phDal4Nfc_i2c_open_and_configure(pphDal4Nfc_sConfig_t pConfig, void ** pLinkHandle)
{
- char * pComPort;
-
DAL_ASSERT_STR(gI2cPortContext.nOpened==0, "Trying to open but already done!");
- switch(pConfig->nLinkType)
- {
- case ENUM_DAL_LINK_TYPE_I2C:
- pComPort = "/dev/pn544";
- break;
- default:
- DAL_DEBUG("Open failed: unknown type %d\n", pConfig->nLinkType);
- return NFCSTATUS_INVALID_PARAMETER;
- }
-
- DAL_DEBUG("Opening port=%s\n", pComPort);
+ DAL_DEBUG("Opening port=%s\n", pConfig->deviceNode);
/* open port */
- gI2cPortContext.nHandle = open(pComPort, O_RDWR | O_NOCTTY);
+ gI2cPortContext.nHandle = open(pConfig->deviceNode, O_RDWR | O_NOCTTY);
if (gI2cPortContext.nHandle < 0)
{
DAL_DEBUG("Open failed: open() returned %d\n", gI2cPortContext.nHandle);