Hi all, I got Multicast Receive working thanks to this very helpful post combined with the advice on this unrelated forum post. In summary, it allowed me to add *this* code to the BsdUdpServer function in the udp_server example (after creation of the socket using sl_Socket):
// multicast group SlSockIpMreq mReq; memset(&mReq, 0, sizeof(SlSockIpMreq)); #define ADDR_MULTICAST_GROUP (0xE0000063) // 224.0.0.99 mReq.imr_interface.s_addr = htonl(INADDR_ANY); mReq.imr_multiaddr.s_addr = htonl(ADDR_MULTICAST_GROUP); if (setsockopt(iSockID, SL_IPPROTO_IP, SL_IP_ADD_MEMBERSHIP, &mReq, sizeof(SlSockIpMreq)) == -1) { sl_Close(iSockID); ASSERT_ON_ERROR(UCP_SERVER_FAILED); } // end multicast group join
and test it from my Windows PC using the following iperf command:
iperf -c 224.0.0.99 -u -T 32 -t 3 -i 60
C:\Users\Victor\Desktop\iperf>iperf -s -u -B 224.0.0.99 -i 1
bind failed: Cannot assign requested address
If anyone knows what's up with that, please share - the internet is not that forthcoming with an answer and/or my google-fu is weak. Anyway, having gotten stuck trying to get Windows to listen in, I figured I'd just use the CC3200 code that I already proved works as a listener as described above. I just ran the same (slightly modified as described above) example code on a two CC3200s. On the first CC3200 I commanded it (via the Serial terminal) to listen on the UDP Multi-Cast group as before. On the second CC3200 I configured it in the terminal to use the UDP Multi-Cast group address as the Destination IP, and commanded it to do the "Send UDP packets" action.
Unfortunately, I did not receive any packets on the listening CC3200's Serial terminal. Both are using the same PORT define obviously, but I didn't add any code to the BsdUdpClient function whereas I did add the code as described above to the BsdUdpServer function. Do I have to add the same code to the BsdUdpClient to get UDP Multi-Cast Sending to work?