Dear expert.
I'm using C6671 + sysbios with NDK _2_21_01_38.
I need a multicast function, but there's some problem.
To use Multicast, my application calls setsockopt() as below.
group.imr_multiaddr.s_addr = inet_addr("224.0.1.129");
group.imr_interface.s_addr = inet_addr("192.168.20.6");
if (setsockopt(sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&group, sizeof(group)) < 0) {
perror("adding multicast group");
close(sd);
exit(1);
}
When I keep following the setsockopt(), i met belows function. It seems register the multicast class D addr.
ndk_2_21_01_38/packages/ti/ndk/stack/igmp/igmp.c
static uint IGMPDoMCast( uint IfIdx, IPN IpAddr, uint fAdd )
{
if (fAdd)
{
/* Add a multicast address; we are already in kernel mode hence we can directly call the
* Device specific IOCTL function. */
if (ptr_device->ioctl (ptr_device, NIMU_ADD_MULTICAST_ADDRESS, (void *)&bMacAddr[0], 6) < 0)
{
/* The Device specific IOCTL Failed. Pass back the error... */
return 0;
}
/* Multicast address was successfully added to the Device Multicast List */
return 1;
}
}
And the IOCTL calls below Emacioctl function in nimu_eth.c.
static int Emacioctl (NETIF_DEVICE* ptr_net_device, uint cmd, void* pBuf, uint size)
{
return 0;
}
There are no Emacioctl implementation.
This is why multicast doesn't work.
Please check if it is right, give some example for multicast. Otherwise let me know right direction.
Best regards.
Jay.