made progress android example sending ir bin to arduino example
This commit is contained in:
@@ -27,8 +27,10 @@
|
||||
#include <cstdint>
|
||||
|
||||
// Wi-Fi Configs
|
||||
#define SECRET_SSID "Maomao的小房子"
|
||||
#define SECRET_PASS "Maomao121207"
|
||||
// #define SECRET_SSID "Maomao的小房子"
|
||||
// #define SECRET_PASS "Maomao121207"
|
||||
#define SECRET_SSID "maomao"
|
||||
#define SECRET_PASS "20121207"
|
||||
|
||||
// LED Matrix Definitions
|
||||
constexpr uint32_t chip[] = {
|
||||
|
||||
@@ -128,6 +128,16 @@ void setup() {
|
||||
}
|
||||
}
|
||||
|
||||
void onCommand(const String *command, WiFiClient *client) {
|
||||
if (command->startsWith(aHello)) {
|
||||
client->println(eBin);
|
||||
client->flush();
|
||||
} else if (command->startsWith(aBin)) {
|
||||
Serial.println("Received bin command");
|
||||
Serial.println(*command);
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (WiFi.status() != WL_CONNECTED) {
|
||||
Serial.print("Connection lost. Reconnecting...");
|
||||
@@ -146,9 +156,10 @@ void loop() {
|
||||
clientConnected = true;
|
||||
}
|
||||
|
||||
if (client.available() > 0) {
|
||||
if (client.available()) {
|
||||
String received = client.readStringUntil('\n');
|
||||
Serial.println(received);
|
||||
onCommand(&received, &client);
|
||||
}
|
||||
} else {
|
||||
if (clientConnected) {
|
||||
|
||||
Reference in New Issue
Block a user