We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I cannot send UDP multicast message in ARM to 1900 port. It is SSDP. netUDP_Send failed with unspecified error.
Any idea?
I will need full SSDP working in keil/ARM.
int32_t udp_sock;
udp_sock = netUDP_GetSocket (udp_cb_func);
netStatus net_status;
if (udp_sock > 0) { // Open UDP port 1000 for communication. net_status = netUDP_Open (udp_sock, 1900); // Let UDP Multicast datagrams cross a router. net_status = netUDP_SetOption (udp_sock, netUDP_OptionTTL, 2); NET_ADDR addr = { NET_ADDR_IP4, 1900, 255, 255, 255, 255 }; uint8_t *sendbuf;
const char* buf = "NOTIFY * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nCACHE-CONTROL: max-age=100\r\n" "NT: upnp:rootdevice\r\nNTS: ssdp:alive\r\nSERVER: device/14.0.0, ProBuf, UPnP/1.1\r\nX-User-Agent: fkuehne-upnpx\r\n\r\n";
u32 size = strlen(buf);
sendbuf = netUDP_GetBuffer (size); strncpy((char*)sendbuf, buf, size);
const uint8_t sgroup[NET_ADDR_IP4_LEN] = { 239,255,255,250 }; char ip_ascii[16]; if (netIGMP_Join (0, sgroup) == netOK) { netIP_ntoa (NET_ADDR_IP4, &sgroup[0], ip_ascii, sizeof(ip_ascii)); } else { return ES_NoError; }
net_status = netUDP_Send (udp_sock, &addr, sendbuf, size); }
Thanks, Naeem