Re: [RTnet-developers] Ethernet IP
Brought to you by:
bet-frogger,
kiszka
|
From: Glen W. <gl...@je...> - 2010-12-02 14:10:21
|
So I cab ignore the error. In the future for compatibility reasons, you may want to return successful in there cases. -- Glen Wernersbach President & CTO Jetsoft Development Co 629 Old St. Rt. 74 - Suite 210 Cincinnati Ohio 45244 Custom Programming Web Site: www.JetsoftDev.com Retail Product Web Site: www.ScanHelp.com Phone: 513-528-6660 Fax: 513-528-3470 On Dec 2, 2010, at 2:52 AM, Jan Kiszka <jan...@we...> wrote: > 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 > |