From 20b7bd5f6985dc890ac99d7d1e8154f965df02db Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Tue, 31 Jan 2012 22:13:33 -0800 Subject: (DEBUG) Add support for setting p2p modes. Change-Id: Ic6df1fc458cef2531119e5e5e2ef5f9a7b21a524 --- src/phHciNfc_NfcIPMgmt.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/phHciNfc_NfcIPMgmt.c') 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) -- cgit v1.1