Skip to content

Commit

Permalink
refactor: move close communication to send message
Browse files Browse the repository at this point in the history
  • Loading branch information
DeimosHall committed Aug 18, 2023
1 parent 98cebc2 commit 2febce4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions examples/NDEFSend/NDEFSend.ino
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,17 @@ void setup() {

nfc.startDiscovery();

Serial.println("Waiting for an NDEF device...");
Serial.print("Waiting for an NDEF device");
}

void loop() {
unsigned long startTime = millis();
Serial.print(".");

if (nfc.isReaderDetected()) {
Serial.println("\nReader detected!");
nfc.sendMessage();
nfc.closeCommunication();
Serial.print("\nWaiting for an NDEF device");
}

Serial.println("Elapsed time: " + String(millis() - startTime) + "ms");
}

void sendMessageCallback(unsigned char *pNdefRecord, unsigned short NdefRecordSize) {
Expand Down
1 change: 1 addition & 0 deletions src/Electroniccats_PN7150.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1748,4 +1748,5 @@ void Electroniccats_PN7150::closeCommunication() {

void Electroniccats_PN7150::sendMessage() {
Electroniccats_PN7150::processCardMode();
Electroniccats_PN7150::closeCommunication();
}

0 comments on commit 2febce4

Please sign in to comment.