You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
378 B
27 lines
378 B
#include "socket.hpp" |
|
|
|
|
|
|
|
Socket socket; |
|
|
|
void callback(const String& s){ |
|
Serial.println(s); |
|
} |
|
|
|
void setup(){ |
|
|
|
Serial.begin(115200); |
|
socket.ini(); |
|
socket.onReceive(callback); |
|
} |
|
|
|
|
|
void loop(){ |
|
socket.core(); |
|
setInterval([](){ |
|
socket.udp("hello socket!!!"+String(random(2000)), [](int e){ |
|
Serial.println("send ok"+String(random(2000))); |
|
}); |
|
}, 7000); |
|
|
|
} |