Skip to content

Commit

Permalink
feat: pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sabas1080 committed Dec 23, 2024
1 parent 1d0550e commit 2bbffa6
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 96 deletions.
8 changes: 4 additions & 4 deletions examples/DetectTags/DetectTags.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Authors:
* Salvador Mendoza - @Netxing - salmg.net
* For Electronic Cats - electroniccats.com
*
*
* Updated by Francisco Torres - Electronic Cats - electroniccats.com
*
* March 2020
Expand All @@ -19,8 +19,8 @@
#define PN7150_VEN (13)
#define PN7150_ADDR (0x28)

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// creates a global NFC device interface object, attached to pins 7 (IRQ) and 8 (VEN) and using the default I2C address 0x28

// Function prototypes
Expand Down Expand Up @@ -67,7 +67,7 @@ void loop() {
nfc.activateNextTagDiscovery();
Serial.println("Multiple cards are detected!");
}

Serial.println("Remove the Card");
nfc.waitForTagRemoval();
Serial.println("Card removed!");
Expand Down
14 changes: 7 additions & 7 deletions examples/DetectingReaders/DetectingReaders.ino
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Example detect tags and show their unique ID
* Authors:
* Example detect tags and show their unique ID
* Authors:
* Salvador Mendoza - @Netxing - salmg.net
* For Electronic Cats - electroniccats.com
*
*
* March 2020
*
* This code is beerware; if you see me (or any other collaborator
* member) at the local, and you've found our code helpful,
*
* This code is beerware; if you see me (or any other collaborator
* member) at the local, and you've found our code helpful,
* please buy us a round!
* Distributed as-is; no warranty is given.
*/
Expand All @@ -18,7 +18,7 @@
#define PN7150_VEN (13)
#define PN7150_ADDR (0x28)

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// Creates a global NFC device interface object, attached to pins 11 (IRQ) and 13 (VEN) and using the default I2C address 0x28

Expand Down
2 changes: 1 addition & 1 deletion examples/ISO14443-3A_read_block/ISO14443-3A_read_block.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#define BLK_NB_ISO14443_3A (5) // Block to be read it

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// creates a global NFC device interface object, attached to pins 7 (IRQ) and 8 (VEN) and using the default I2C address 0x28

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define BLK_NB_ISO14443_3A (5) // Block to be read it
#define DATA_WRITE_ISO14443_3A 0x11, 0x22, 0x33, 0x44 // Data to write

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// creates a global NFC device interface object, attached to pins 7 (IRQ) and 8 (VEN) and using the default I2C address 0x28

Expand Down
4 changes: 2 additions & 2 deletions examples/ISO15693_read_block/ISO15693_read_block.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#define BLK_NB_ISO15693 (8) // Block to be read it

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// creates a global NFC device interface object, attached to pins 7 (IRQ) and 8 (VEN) and using the default I2C address 0x28

Expand Down Expand Up @@ -123,7 +123,7 @@ void loop() {
if (nfc.remoteDevice.hasMoreTags()) {
nfc.activateNextTagDiscovery();
}

Serial.println("Remove the Card");
nfc.waitForTagRemoval();
Serial.println("CARD REMOVED!");;
Expand Down
2 changes: 1 addition & 1 deletion examples/ISO15693_write_block/ISO15693_write_block.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define BLK_NB_ISO15693 (8) // Block to write
#define DATA_WRITE_ISO15693 0x11, 0x22, 0x33, 0x44 // Data to write

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// creates a global NFC device interface object, attached to pins 7 (IRQ) and 8 (VEN) and using the default I2C address 0x28

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#define BLK_NB_MFC 4 // Block tat wants to be read
#define KEY_MFC 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF // Default Mifare Classic key
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// creates a global NFC device interface object, attached to pins 11 (IRQ) and 13 (VEN) and using the default I2C address 0x28

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// Data to be written in the Mifare Classic block
#define DATA_WRITE_MFC 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// creates a global NFC device interface object, attached to pins 7 (IRQ) and 8 (VEN) and using the default I2C address 0x28

Expand Down
2 changes: 1 addition & 1 deletion examples/NDEFReadMessage/NDEFReadMessage.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void displayDeviceInfo();
void displayRecordInfo(NdefRecord record);

// Create a global NFC device interface object, attached to pins 11 (IRQ) and 13 (VEN) and using the default I2C address 0x28
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);

NdefMessage message;
Expand Down
4 changes: 2 additions & 2 deletions examples/NDEFSendMessage/NDEFSendMessage.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
// Function prototypes
void messageSentCallback();

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// Creates a global NFC device interface object, attached to pins 11 (IRQ) and 13 (VEN) and using the default I2C address 0x28
NdefMessage message;

Expand Down
2 changes: 1 addition & 1 deletion examples/NDEFSendRawMessage/NDEFSendRawMessage.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// Function prototypes
void messageSentCallback();

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// Creates a global NFC device interface object, attached to pins 11 (IRQ) and 13 (VEN) and using the default I2C address 0x28
NdefMessage message;
Expand Down
34 changes: 17 additions & 17 deletions examples/P2P_Discovery/P2P_Discovery.ino
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/**
* Example to detect P2P device
* Authors:
* Example to detect P2P device
* Authors:
* Salvador Mendoza - @Netxing - salmg.net
* For Electronic Cats - electroniccats.com
*
*
* March 2020
*
* This code is beerware; if you see me (or any other collaborator
* member) at the local, and you've found our code helpful,
*
* This code is beerware; if you see me (or any other collaborator
* member) at the local, and you've found our code helpful,
* please buy us a round!
* Distributed as-is; no warranty is given.
*/

#include "Electroniccats_PN7150.h"
#include "Electroniccats_PN7150.h"
#define PN7150_IRQ (11)
#define PN7150_VEN (13)
#define PN7150_ADDR (0x28)

Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7150);
//Electroniccats_PN7150 nfc(PN7150_IRQ, PN7150_VEN, PN7150_ADDR, PN7160);
// creates a global NFC device interface object, attached to pins 11 (IRQ) and 13 (VEN) and using the default I2C address 0x28
RfIntf_t RfInterface; //Intarface to save data for multiple tags
Expand All @@ -26,7 +26,7 @@ uint8_t mode = 3; // modes: 1 =

void ResetMode(){ //Reset the configuration mode after each reading
Serial.println("Re-initializing...");
nfc.ConfigMode(mode);
nfc.ConfigMode(mode);
nfc.StartDiscovery(mode);
}

Expand All @@ -35,20 +35,20 @@ void setup(){
Serial.begin(9600);
while(!Serial);
Serial.println("Detect P2P devices with PN7150/60");
Serial.println("Initializing...");

Serial.println("Initializing...");
if (nfc.connectNCI()) { //Wake up the board
//if (nfc.connectNCI_PN7160()) { // Wake up the board
Serial.println("Error while setting up the mode, check connections!");
while (1);
}

if (nfc.configureSettings()) {
//if (nfc.configureSettings_PN7160()) {
Serial.println("The Configure Settings failed!");
while (1);
}

if(nfc.ConfigMode(mode)){ //Set up the configuration mode
Serial.println("The Configure Mode failed!!");
while (1);
Expand All @@ -58,13 +58,13 @@ void setup(){
}

void loop(){
if(!nfc.WaitForDiscoveryNotification(&RfInterface)){ // Waiting to detect
if(!nfc.WaitForDiscoveryNotification(&RfInterface)){ // Waiting to detect
if (RfInterface.Interface == INTF_NFCDEP) {
if ((RfInterface.ModeTech & MODE_LISTEN) == MODE_LISTEN)
if ((RfInterface.ModeTech & MODE_LISTEN) == MODE_LISTEN)
Serial.println(" - P2P TARGET MODE: Activated from remote Initiator");
else
else
Serial.println(" - P2P INITIATOR MODE: Remote Target activated");

/* Process with SNEP for NDEF exchange */
nfc.processP2pMode(RfInterface);
Serial.println("Peer lost!");
Expand Down
Loading

0 comments on commit 2bbffa6

Please sign in to comment.