Multicast Receiver

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
Post Reply
bmacdbacks
New User
Posts: 3
Joined: Tue Nov 14, 2017 3:55 pm

Multicast Receiver

Post by bmacdbacks »

I have the xCORE-200 Explorer kit and I'm trying to receive a multicast message that presents on 224.224.24.23:11007.
I've been using xtcp to send/receive in a server/client model but I'm at a loss if its possible to use the same library for receiving a multicast message.
At the moment it's really a guess to me as to why there would be function for joining a multicast group but not include a port to send/receive messages. I'm currently doing the following, though obviously it's not working.
Are there any examples of receiving multicast message using xtcp or any tips?

xtcp_ipaddr_t ip_add = {224,224,24,23};
int port_num = 11007;

xtcp_join_multicast_group(c_xtcp, ip_add);
//xtcp_listen(c_xtcp, port_num, XTCP_PROTOCOL_UDP);
while (1)
{
select
{
// Respond to an event from the tcp server
case xtcp_event(c_xtcp, conn):
switch (conn.event)
{
case XTCP_IFUP:
xtcp_connect(c_xtcp,port_num,ip_add, XTCP_PROTOCOL_UDP);
break;
case XTCP_IFDOWN:
break;
case XTCP_NEW_CONNECTION:
if (responding_connection.id == INIT_VAL)
responding_connection = conn;
else
xtcp_close(c_xtcp, conn);
break;
case XTCP_RECV_DATA:
response_len = xtcp_recv_count(c_xtcp, rx_buffer, RX_BUFFER_SIZE);
rx_buffer[response_len] = 0;
............


bmacdbacks
New User
Posts: 3
Joined: Tue Nov 14, 2017 3:55 pm

Post by bmacdbacks »

So there's client/server examples and a UDP example that includes performing a multicast broadcast, but there appears to be no way to receive a multicast packet, as only local ports are available to listen to. Apparently in XMOS land everyone just needs to send broadcast messages, this is inherently short sighted. I guess at this point I'll just have to cut my loses and find a product that actually fully supports UDP and doesn't just advertise it. Frustrating but now I know not to use XMOS products and to make sure none of the engineers I work use them either!
User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

A little excessive, considering XMOS gives you the code you can probably add the feature yourself. I honestly use XMOS for its other features and libraries and am happy they have some basic UDP and TCP to use, if all I wanted to do was listen for multicast UDP I would probably use some other mcu with a programming model I am more comfortable with. I think lwIP supports the feature you're looking for or if not you could patch it. Good luck!
Post Reply