From 70ade65582fe1a9475b1a6eb8b20104838d551a3 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 28 Apr 2015 07:16:33 +0800 Subject: [PATCH] Describe multicast APIs in readme, update keywords. --- README.md | 8 ++++++++ libraries/ESP8266WiFi/keywords.txt | 1 + 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 0290b153b..52187ff99 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,14 @@ This is mostly similar to WiFi shield library. Differences include: - ```WiFi.localIP()``` is for STA, ```WiFi.softAPIP()``` is for AP. - ```WiFi.RSSI()``` doesn't work - ```WiFi.printDiag(Serial);``` will print out some diagnostic info +- ```WiFiUDP``` class supports sending and receiving multicast packets on STA interface. +When sending a multicast packet, replace ```udp.beginPacket(addr, port)``` with +```udp.beginPacketMulticast(addr, port, WiFi.localIP())```. +When listening to multicast packets, replace ```udp.begin(port)``` with +```udp.beginMulticast(WiFi.localIP(), multicast_ip_addr, port)```. +You can use ```udp.destinationIP()``` to tell whether the packet received was +sent to the multicast or unicast address. +Also note that multicast doesn't work on softAP interface. WiFiServer, WiFiClient, and WiFiUDP behave mostly the same way as with WiFi shield library. Four samples are provided for this library. diff --git a/libraries/ESP8266WiFi/keywords.txt b/libraries/ESP8266WiFi/keywords.txt index b61a30d70..e693ea4da 100644 --- a/libraries/ESP8266WiFi/keywords.txt +++ b/libraries/ESP8266WiFi/keywords.txt @@ -53,6 +53,7 @@ remotePort KEYWORD2 softAP KEYWORD2 softAPIP KEYWORD2 softAPmacAddress KEYWORD2 +softAPConfig KEYWORD2 printDiag KEYWORD2 hostByName KEYWORD2 scanNetworks KEYWORD2