Sending UDP messages from xenomai context
Dnia Środa, 8 Listopada 2017 12:13 Schmeits Cedric (DC-AE/EHP2) <[email protected]> napisał(a)
Quoted 23 lines
Hello,
I'm in the need of sending out an UDP package after calculations done within the context of a xenomai thread. Currently the sending is done, but the thread is migrated to the linux domain.
Currently i'm using the following setup to send out the packages:
int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); struct sockaddr_in addr; memset((char *) &addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_port = htons(5678); .... int ret = sendto(s, pBuffer, bufferSize, 0, (struct sockaddr*)&addr, sizeof(addr));Slackspot is telling me the following:
#3 0x0000000000013a68 __real_sendto() in [/usr/xenomai/lib/libcobalt.so.2.0.0] #4 0x00000000000111d2 __cobalt_sendto() in [/usr/xenomai/lib/libcobalt.so.2.0.0]So mine question is, is there a way of sending out the UDP message and without migrating to the linux domain? One possibility I came up with, until now, is to have an additional thread running in the linux domain that handles the communication, but that will cause extra undeterministic delay, which I would like to prevent.
Quoted 6 lines
I know that there is RTnet, but the receiving side does not have the possibility to implement this.
Best regards,
Cedric Schmeits
Hi,
The task migrates to the Linux domain because you invoke a linux syscall, by calling sendto on the socket managed by the Linux domain. You need a network stack which is handled by the Xenomai domain -- only I know is RTnet. You can omit the TDMA layer in the RTnet configuration (by setting nomac). Then you can communicate with others machines that have a common network stack (Linux, Windows, etc. ). This issue has been already discuses, so please refer to previous posts. .
Best regards,
Mariusz
Quoted 4 lines
_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai