0

I wrote a small app that controls Lights over the ArtNet Protocol. The Whole send code is based on Libartnet (https://github.com/OpenLightingProject/libartnet).

It works fine on my iPad where I first installed it a few years ago. But when trying it on a new device - no data is find in the Wifi (tried to log it with Wireshark). in iOS Simulator or on the Mac it works fine but on an actual device nothing happened, but sending didn't fail.

int artnet_net_send(node n, artnet_packet p) {
  struct sockaddr_in addr;
  int ret;

  if (n->state.mode != ARTNET_ON)
    return ARTNET_EACTION;

  addr.sin_family = AF_INET;
  addr.sin_port = htons(ARTNET_PORT);
  addr.sin_addr = p->to;
  p->from = n->state.ip_addr;

  if (n->state.verbose)
    printf("sending to %s\n" , inet_ntoa(addr.sin_addr));

  ret = sendto(n->sd,
               (char*) &p->data, // char* required for win32
               p->length,
               0,
               (SA*) &addr,
               sizeof(addr));
  if (ret == -1) {
    artnet_error("Sendto failed: %s", artnet_net_last_error());
    n->state.report_code = ARTNET_RCUDPFAIL;
    return ARTNET_ENET;

  } else if (p->length != ret) {
    artnet_error("failed to send full datagram");
    n->state.report_code = ARTNET_RCSOCKETWR1;
    return ARTNET_ENET;
  }

  if (n->callbacks.send.fh) {
    get_type(p);
    n->callbacks.send.fh(n, p, n->callbacks.send.data);
  }
  return ARTNET_EOK;
}

First I thought it must be a missing entitlement that apple added later on so I ask for the "com.apple.developer.networking.multicast" but it's still not working.

Does anybody has an idea?

0 Answers0