diff --git a/GPN_BadgeLasertag.ino b/GPN_BadgeLasertag.ino index 0ff4d8f1a076587ee380ef4490a6f3323b6b7fb8..82896f2a2aca9e6c50ed67b3c2446cadca00b9af 100644 --- a/GPN_BadgeLasertag.ino +++ b/GPN_BadgeLasertag.ino @@ -81,39 +81,6 @@ void hostGame() { #endif } -bool isNumber(char number){ - return number >= 0x30 && number <= 0x39; -} - -bool isValidIp(String ip){ - - unsigned short pos0 = ip.indexOf('.'); - unsigned short pos1 = ip.indexOf('.', pos0+1); - unsigned short pos2 = ip.indexOf('.', pos1+1); - - String tuple0 = ip.substring(0, pos0); - String tuple1 = ip.substring(pos0 + 1, pos1); - String tuple2 = ip.substring(pos1 + 1, pos2); - String tuple3 = ip.substring(pos2 + 1, ip.length() - 1); - - bool isValid = true; - - for (int i = 0; i < tuple0.length(); i++){ - Serial.printf("tuple0: %d -> %c\n", i, tuple0[i]); - isValid &= isNumber(tuple0[i]); - } - for (int i = 0; i < tuple1.length(); i++){ - Serial.printf("tuple1: %d -> %c\n", i, tuple1[i]); - } - for (int i = 0; i < tuple2.length(); i++){ - Serial.printf("tuple2: %d -> %c\n", i, tuple2[i]); - } - for (int i = 0; i < tuple3.length(); i++){ - Serial.printf("tuple3: %d -> %c\n", i, tuple3[i]); - } - -} - String recv_ir() { badge.setGPIO(IR_EN, HIGH); Serial.println("Entering receive mode");