Added more inputTypes

main
gialexpro 3 years ago
parent 3397b2e6ef
commit 2ae98c8ab1
  1. 2
      android/UDPtest000/.idea/gradle.xml
  2. 60
      arduino/esp32-s3/AsyncUDPServer.ino
  3. 2
      arduino/esp32-s3/gg/arduino_secrets.h
  4. 1009
      arduino/esp32-s3/gg/gg.ino

@ -7,7 +7,7 @@
<option name="testRunner" value="GRADLE" /> <option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" /> <option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="Embedded JDK" /> <option name="gradleJvm" value="Android Studio default JDK" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />

@ -1,60 +0,0 @@
#include "WiFi.h"
#include "AsyncUDP.h"
#include "arduino_secrets.h"
const char * ssid = SECRET_SSID;
const char * password = SECRET_PASS;
const int channel = 1;
const bool hide_SSID = false;
const int max_connections = 3;
AsyncUDP udp;
IPAddress local_ip(192,168,4,1);
IPAddress gateway(192,168,4,1);
IPAddress subnet(255,255,255,0);
void setup()
{
delay(3000);
Serial.begin(115200);
WiFi.mode(WIFI_AP);
WiFi.softAPConfig(local_ip, gateway, subnet);
WiFi.softAP(ssid, password, channel, hide_SSID, max_connections);
Serial.println(WiFi.softAPIP());
if(udp.listen(9696)) {
Serial.println("UDP Listening");
udp.onPacket([](AsyncUDPPacket packet) {
Serial.print("UDP Packet Type: ");
Serial.print(packet.isBroadcast()?"Broadcast":packet.isMulticast()?"Multicast":"Unicast");
Serial.print(", From: ");
Serial.print(packet.remoteIP());
Serial.print(":");
Serial.print(packet.remotePort());
Serial.print(", To: ");
Serial.print(packet.localIP());
Serial.print(":");
Serial.print(packet.localPort());
Serial.print(", Length: ");
Serial.print(packet.length());
Serial.print(", Data: ");
Serial.write(packet.data(), packet.length());
Serial.println();
//reply to the client
packet.printf("Got %u bytes of data", packet.length());
});
}
}
void loop()
{
delay(3000);
//Send broadcast
//udp.broadcast("Anyone here?");
Serial.println(WiFi.softAPIP());
}

@ -1,2 +1,2 @@
#define SECRET_SSID "wifi" #define SECRET_SSID "ggwifi"
#define SECRET_PASS "password" #define SECRET_PASS "password"

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save