Skip to content

Commit

Permalink
Update and rename TapToEsp32.ino to ZaparooEsp32.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
v1605 authored Nov 17, 2024
1 parent f115afa commit 5f08d59
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions TapToEsp32.ino → ZaparooEsp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#include <AudioOutputI2S.h>
#include <AudioGeneratorMP3.h>
#include <LittleFS.h>
#include <TapToLaunchApi.h>
#include "TapToEsp32.hpp"
#include <ZaparooLaunchApi.h>
#include "ZaparooEsp32.hpp"

//Config found in ReadTag.hpp
//Config found in .hpp file

MFRC522 mfrc522(SS_PIN, RST_PIN);
NfcAdapter nfc = NfcAdapter(&mfrc522);
TapToLaunchApi client;
ZaparooLaunchApi client;
AudioOutputI2S* out;
boolean wifiEnabled = false;
String lastId="";
Expand All @@ -24,7 +24,7 @@ void setup() {
setupPins();
#ifndef SERIAL_ONLY
initWiFi();
client.url(tapToUrl);
client.url(zaparooUrl);
#endif
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522
Expand Down Expand Up @@ -123,7 +123,7 @@ void playAudio(){
#endif
}

bool sendTapTo(String& gamePath){
bool send(String& gamePath){
if(!wifiEnabled) return true;
int code = client.launch(gamePath);
if(code > 0){
Expand All @@ -132,7 +132,7 @@ bool sendTapTo(String& gamePath){
return code == 0;
}

bool sendTapToUid(String& uid){
bool sendUid(String& uid){
if(!wifiEnabled) return true;
int code = client.launchUid(uid);
if(code > 0){
Expand Down Expand Up @@ -189,11 +189,11 @@ void loop(void) {
}
foundMessage = !payloadAsString.equalsIgnoreCase("");
if(foundMessage){
if(sendTapTo(payloadAsString)){
if(send(payloadAsString)){
Serial.print("SCAN\t" + payloadAsString + "\n");
Serial.flush();
successActions();
}
}
nfc.haltTag();
delay(900);
}
Expand All @@ -203,7 +203,7 @@ void loop(void) {
String toSend = id;
toSend.replace(" ", "");
toSend.toLowerCase();
if(sendTapToUid(toSend)){
if(sendUid(toSend)){
Serial.print("SCAN\tuid=" + toSend+ "\n");
Serial.flush();
successActions();
Expand Down

0 comments on commit 5f08d59

Please sign in to comment.