AW: [En-Nut-Discussion] Sending broadcasts (WOL)

Oliver Schulz olischulz at web.de
Thu Oct 7 23:54:39 CEST 2004


Try broadcast address 255.255.255.255 or 0xFFFFFFFF.

Regards,
Oliver.

> -----Ursprüngliche Nachricht-----
> Von: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Hugo Simon
> Gesendet: Donnerstag, 7. Oktober 2004 21:20
> An: Ethernut User Chat (English)
> Betreff: [En-Nut-Discussion] Sending broadcasts (WOL)
>
>
> Hi,
>
> I want to send MagicPackets with an Ethernut to power up a PC
> via WakeOnLAN.
> But I cannot send anything to a computer which is switched
> of. Ethernut
> cries out some ARP requests and get no answer. As I
> understand that I have
> to send an UDP Broadcast to my subnet. But how?
>
> I tried to send to addres 192.168.100.0 and 192.168.100.255.
> Subnetmask is
> 255.255.255.0 and Ethernut's IP is 192.168.100.48.
>
> No difference. Ethernet always sends ARP requests. So I think
> I have to say
> somehow that I want to send a broadcast, but how?
>
> Can anybody help?
>
> Here is my sending code:
>
>  fprintf(stream,"Sending MagicPacket to %s\r\n",inet_ntoa(destIP));
>  u_short wolport=1000;
>  UDPSOCKET *udp;
>  udp=NutUdpCreateSocket(wolport);
>  if (!udp)
>  {
>   fputs("Internal error: Cannot create UDP socket",stream);
>   free(buffer);
>   return 1;
>  }
>  // for safety send the magic packet five times
>   NutUdpSendTo(udp, destIP, wolport, buffer,sizeof(buffer));
>  NutUdpDestroySocket(udp);
>
>  free(buffer);
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list