Am 01.12.2010 23:34, Glen Wernersbach wrote:
> Hi All,
> 
> Back at this. My program now compiles. I think I am loading all the correct
> libraries to do just NIC, UDP and TCP with RTNET:
>> insmod /usr/realtime/modules/rtai_hal.ko
>> insmod /usr/realtime/modules/rtai_lxrt.ko
>> insmod /usr/realtime/modules/rtai_sem.ko
>> insmod /usr/realtime/modules/rtai_rtdm.ko
>> rmmod e1000e
>> insmod /usr/rtnet/modules/rtnet.ko
>> insmod /usr/rtnet/modules/rtipv4.ko
>> insmod /usr/rtnet/modules/rtpacket.ko
>> insmod /usr/rtnet/modules/rt_loopback.ko
>> insmod /usr/rtnet/modules/rt_e1000.ko
>> /usr/src/rtnet-0.9.12/tools/./rtifconfig rteth1 up 192.168.0.2
>> /usr/src/rtnet-0.9.12/tools/./rtifconfig rtlo up 127.0.0.1
>> insmod /usr/rtnet/modules/rtudp.ko
>> insmod /usr/rtnet/modules/rttcp.ko
>> ./opener 192.168.0.2 255.255.255.0 192.168.0.1 test.com testdevice 00 0E 8C 
>> 9F
>> 16 09
> 
> I current am not connected to a host but am just trying to debug as far as a
> I can with this just this side. This all works until the last function:

[ Note that functional debugging is also feasible in QEMU/KVM using e.g.
the emulated rtl8139. ]

> 
>>  /* create a new TCP socket */
>>   if ((nTCPListener = rt_dev_socket(PF_INET, SOCK_STREAM, 0)) == -1)
>>     {
>>       OPENER_TRACE_ERR("error allocating socket stream listener, %d\n",
>> errno);
>>       return EIP_ERROR;
>>     }
>>
>>   /* create a new UDP socket */
>>   if ((nUDPListener = rt_dev_socket(PF_INET, SOCK_DGRAM, 0)) == -1)
>>     {
>>       OPENER_TRACE_ERR("error allocating udp listener socket, %d\n", errno);
>>       return EIP_ERROR;
>>     }
>>
>>   my_addr.sin_family = AF_INET;
>>   my_addr.sin_port = htons(OPENER_ETHERNET_PORT);
>>   my_addr.sin_addr.s_addr = htonl(INADDR_ANY);
>>   memset(&my_addr.sin_zero, 0, sizeof(my_addr.sin_zero));
>>
>>   /* bind the new socket to port 0xAF12 (CIP) */
>>   if ((rt_dev_bind(nTCPListener, (struct sockaddr *) &my_addr, sizeof(struct
>> sockaddr)))
>>       == -1)
>>     {
>>       OPENER_TRACE_ERR("error with bind: %d %s", errno, strerror(errno));
>>       return EIP_ERROR;
>>     }
>>
>>   /* enable the udp socket to receive broadcast messages*/
>>   y = 1;
>>   if (0 > rt_dev_setsockopt(nUDPListener, SOL_SOCKET, SO_BROADCAST, &y,
>> sizeof(int)))
>>     {
>>       OPENER_TRACE_ERR("error with setting broadcast receive for udp socket:
>> %d %s", errno, strerror(errno));
>>       return EIP_ERROR;
>>     }
> 
> The above function returns ³38  function not implemented²
> 
> Do I need to be connected for this to work?
> 
> Are my load modules right?
> 
> Is this function really not implemented or am I doing something wrong?
> 
> If it is not implemented, is there a work around?

SO_BROADCAST is indeed not implemented. RT-UDP sockets have this feature
automatically enabled.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
RTnet-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rtnet-developers

Reply via email to