Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Unable to render {include} The included page could not be found.
Unable to render {include} The included page could not be found.

Joining and Leaving an IGMP Host Group

µC/TCP-IP supports IP multicasting with IGMP. In order to receive packets addressed to a given IP multicast group address, the stack must have been configured to support multicasting in net_cfg.h, and that host group has to be joined.

The following examples show how to join and leave an IP multicast group with µC/TCP-IP:

 

NET_IF_NBR if_nbr;

NET_IP_ADDR group_ip_addr;

NET_ERR err;

 

 

if_nbr = NET_IF_NBR_BASE_CFGD;

group_ip_addr = NetASCII_Str_to_IP(“233.0.0.1”, &err);

if (err != NET_ASCII_ERR_NONE) {

/* Handle error. */

}

NetIGMP_HostGrpJoin(if_nbr, group_ip_addr, &err);

if (err != NET_IGMP_ERR_NONE) {

/* Handle error. */

}

[...]

NetIGMP_HostGrpLeave(if_nbr, group_ip_addr, &err);

if (err != NET_IGMP_ERR_NONE) {

/* Handle error. */

}

  • No labels