本项止转自github官方arduino-esp32 传在这里仅为阅读源码方便
projectuser
2019-07-05 50148ccffe21ff54262064ec9f2245900eaf18aa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# This ruby script listens on UDP port 3333 
# for messages from the ESP32 board and prints them
 
require 'socket'
include Socket::Constants
 
udp_socket = UDPSocket.new(AF_INET)
 
#bind 
udp_socket.bind("", 3333)
puts 'Server listening'
 
while true do
  message, sender = udp_socket.recvfrom(1024)
  puts message
end