Question about PN7160 example - SW6705

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Question about PN7160 example - SW6705

Jump to solution
490 Views
OilCastle
Contributor III

Hi.
I'm trying to add the SW6705 code to my Zephyr based project.


The compiler returned some warnings and I also think it looks weird.

- File
\\NXP-NCI2.0_MCUXpresso_examples\NXP-NCI2.0_LPC55S6x_examples\NfcLibrary\NxpNci20\src\NxpNci20.c
- Line number: 989

if (AnswerSize != 0)
{
    /* Flush any other notification  */
    while(Answer != 0) NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_100MS);
    /* Restart the discovery loop */ 
    NxpNci_HostTransceive(NCIRestartDiscovery, sizeof(NCIRestartDiscovery), Answer, sizeof(Answer), &AnswerSize);
    NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_100MS);
}
goto wait;

 

I think "while(Answer != 0)" could be a problem because that symbol is pointer, not regular variable.

uint8_t NCIRfDiscoverSelect[] = {0x21, 0x04, 0x03, 0x01, PROT_ISODEP, INTF_ISODEP};
uint8_t Answer[MAX_NCI_FRAME_SIZE];
uint16_t AnswerSize;


I'm not sure what's the intention of this code.

 

Please, someone explain to me about this.

(If I'm missing something, please let me know.)

 

 

Thank you.

 

Labels (1)
Tags (3)
0 Kudos
Reply
1 Solution
465 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @OilCastle

Hope you are doing well.

That portion of code is related to Peer-to-Peer (P2P) support; this functionality is deprecated.

If not required, you can skip the code wrapped within "REMOVE_P2P_SUPPORT" macro.

Regards,
Eduardo.

View solution in original post

0 Kudos
Reply
1 Reply
466 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @OilCastle

Hope you are doing well.

That portion of code is related to Peer-to-Peer (P2P) support; this functionality is deprecated.

If not required, you can skip the code wrapped within "REMOVE_P2P_SUPPORT" macro.

Regards,
Eduardo.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2334956%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EQuestion%20about%20PN7160%20example%20-%20SW6705%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2334956%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi.%3CBR%20%2F%3EI'm%20trying%20to%20add%20the%20SW6705%20code%20to%20my%20Zephyr%20based%20project.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20compiler%20returned%20some%20warnings%20and%20I%20also%20think%20it%20looks%20weird.%3CBR%20%2F%3E%3CBR%20%2F%3E-%20File%3CBR%20%2F%3E%5C%5CNXP-NCI2.0_MCUXpresso_examples%5CNXP-NCI2.0_LPC55S6x_examples%5CNfcLibrary%5CNxpNci20%5Csrc%5CNxpNci20.c%3CBR%20%2F%3E-%20Line%20number%3A%20989%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Eif%20(AnswerSize%20!%3D%200)%0A%7B%0A%20%20%20%20%2F*%20Flush%20any%20other%20notification%20%20*%2F%0A%20%20%20%20while(Answer%20!%3D%200)%20NxpNci_WaitForReception(Answer%2C%20sizeof(Answer)%2C%20%26amp%3BAnswerSize%2C%20TIMEOUT_100MS)%3B%0A%20%20%20%20%2F*%20Restart%20the%20discovery%20loop%20*%2F%20%0A%20%20%20%20NxpNci_HostTransceive(NCIRestartDiscovery%2C%20sizeof(NCIRestartDiscovery)%2C%20Answer%2C%20sizeof(Answer)%2C%20%26amp%3BAnswerSize)%3B%0A%20%20%20%20NxpNci_WaitForReception(Answer%2C%20sizeof(Answer)%2C%20%26amp%3BAnswerSize%2C%20TIMEOUT_100MS)%3B%0A%7D%0Agoto%20wait%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3EI%20think%20%22%3CSPAN%3Ewhile%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EAnswer%20%3C%2FSPAN%3E%3CSPAN%3E!%3D%3C%2FSPAN%3E%20%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E)%22%20could%20be%20a%20problem%20because%20that%20symbol%20is%20pointer%2C%20not%20regular%20variable.%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Euint8_t%20NCIRfDiscoverSelect%5B%5D%20%3D%20%7B0x21%2C%200x04%2C%200x03%2C%200x01%2C%20PROT_ISODEP%2C%20INTF_ISODEP%7D%3B%0Auint8_t%20Answer%5BMAX_NCI_FRAME_SIZE%5D%3B%0Auint16_t%20AnswerSize%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3EI'm%20not%20sure%20what's%20the%20intention%20of%20this%20code.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPlease%2C%20someone%20explain%20to%20me%20about%20this.%3C%2FP%3E%3CP%3E(If%20I'm%20missing%20something%2C%20please%20let%20me%20know.)%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3EThank%20you.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2334956%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ENFC%20Reader%20Library%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2335488%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Question%20about%20PN7160%20example%20-%20SW6705%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2335488%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F82066%22%20target%3D%22_blank%22%3E%40OilCastle%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EHope%20you%20are%20doing%20well.%3C%2FP%3E%0A%3CP%3EThat%20portion%20of%20code%20is%20related%20to%20Peer-to-Peer%20(P2P)%20support%3B%20this%20functionality%20is%20deprecated.%3C%2FP%3E%0A%3CP%3EIf%20not%20required%2C%20you%20can%20skip%20the%20code%20wrapped%20within%20%22REMOVE_P2P_SUPPORT%22%20macro.%3C%2FP%3E%0A%3CP%3ERegards%2C%3CBR%20%2F%3EEduardo.%3C%2FP%3E%3C%2FLINGO-BODY%3E