Chat freely about anything...

User avatar
By wizhippo
#6473 Just though I would share in case anyone else needs to use igmp I can confirm it works. I have used the iot_demo as its lwip has igmp enabled. Below is the code I used on wifi connection.

Code: Select all      case STATION_GOT_IP:
         wifi_get_ip_info(STATION_IF, &ipConfig);
         if(ipConfig.ip.addr != 0) {
            connState = WIFI_CONNECTED;
            {
               struct netif* netif = eagle_lwip_getif(STATION_IF);
               if (NULL != netif) {
                  if (!(netif->flags & NETIF_FLAG_IGMP)) {
                     netif->flags |= NETIF_FLAG_IGMP;
                     igmp_start(netif);
                  }

                  ip_addr_t ipgroup;
                  ipaddr_aton("239.255.0.1", &ipgroup);
                  err_t err = igmp_joingroup(&netif->ip_addr, &ipgroup);
                  if(ERR_OK == err) {
                     dmx_sever_init();
                  } else {
                     // ERROR("igmp_joingroup result %d", err);
                  }
               }  else {
                  // ERROR("netif %d", netif);
               }
            }

            return;
         }
         break;