summaryrefslogtreecommitdiffstats
path: root/src/phHciNfc_NfcIPMgmt.c
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2012-01-31 22:13:33 -0800
committerMartijn Coenen <maco@google.com>2012-02-17 14:11:36 -0800
commit20b7bd5f6985dc890ac99d7d1e8154f965df02db (patch)
tree8be8a057f1264148be962251541cf48cda577005 /src/phHciNfc_NfcIPMgmt.c
parent6bd5058796097ae40ed41c283a69e7874f2e9db2 (diff)
downloadexternal_libnfc-nxp-20b7bd5f6985dc890ac99d7d1e8154f965df02db.zip
external_libnfc-nxp-20b7bd5f6985dc890ac99d7d1e8154f965df02db.tar.gz
external_libnfc-nxp-20b7bd5f6985dc890ac99d7d1e8154f965df02db.tar.bz2
(DEBUG) Add support for setting p2p modes.
Change-Id: Ic6df1fc458cef2531119e5e5e2ef5f9a7b21a524
Diffstat (limited to 'src/phHciNfc_NfcIPMgmt.c')
-rw-r--r--src/phHciNfc_NfcIPMgmt.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/phHciNfc_NfcIPMgmt.c b/src/phHciNfc_NfcIPMgmt.c
index ed26ba3..68449be 100644
--- a/src/phHciNfc_NfcIPMgmt.c
+++ b/src/phHciNfc_NfcIPMgmt.c
@@ -1160,7 +1160,6 @@ phHciNfc_NfcIP_Info_Sequence (
rem_nfcipinfo->NfcIP_Info.Nfcip_Active =
p_nfcipinfo->activation_mode;
-
if (NFCIP_INITIATOR == p_nfcipinfo->nfcip_type)
{
phNfc_sCompletionInfo_t CompInfo;
@@ -1403,8 +1402,34 @@ phHciNfc_NfcIP_InfoUpdate(
p_nfcipinfo->initiator_speed = (phHciNfc_eP2PSpeed_t)
((*reg_value >> NFCIP_COMM_INITIATOR_SHIFT)
& NFCIP_COMM_FACTOR);
+ if (p_nfcipinfo->nfcip_type == NFCIP_INITIATOR) {
+ switch(p_nfcipinfo->initiator_speed) {
+ case phNfc_eDataRate_106:
+ ALOGI("I'm P2P %s Initiator @ 106 kb/s", p_nfcipinfo->activation_mode ? "Active" : "Passive");
+ break;
+ case phNfc_eDataRate_212:
+ ALOGI("I'm P2P %s Initiator @ 212 kb/s", p_nfcipinfo->activation_mode ? "Active" : "Passive");
+ break;
+ case phNfc_eDataRate_424:
+ ALOGI("I'm P2P %s Initiator @ 424 kb/s", p_nfcipinfo->activation_mode ? "Active" : "Passive");
+ break;
+ }
+ }
p_nfcipinfo->target_speed = (phHciNfc_eP2PSpeed_t)
(*reg_value & NFCIP_COMM_FACTOR);
+ if (p_nfcipinfo->nfcip_type == NFCIP_TARGET) {
+ switch(p_nfcipinfo->target_speed) {
+ case phNfc_eDataRate_106:
+ ALOGI("I'm P2P %s Target @ 106 kb/s", p_nfcipinfo->activation_mode ? "Active" : "Passive");
+ break;
+ case phNfc_eDataRate_212:
+ ALOGI("I'm P2P %s Target @ 212 kb/s", p_nfcipinfo->activation_mode ? "Active" : "Passive");
+ break;
+ case phNfc_eDataRate_424:
+ ALOGI("I'm P2P %s Target @ 424 kb/s", p_nfcipinfo->activation_mode ? "Active" : "Passive");
+ break;
+ }
+ }
p_nfcipinfo->max_frame_len = NFCIP_DATA_RATE_CALC(*reg_value);
if (p_nfcipinfo->max_frame_len > NFCIP_MAX_DEP_REQ_HDR_LEN)