Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding non-sequential universes in multicast #10

Open
TyIsI opened this issue Sep 10, 2020 · 2 comments
Open

Adding non-sequential universes in multicast #10

TyIsI opened this issue Sep 10, 2020 · 2 comments

Comments

@TyIsI
Copy link

TyIsI commented Sep 10, 2020

Hi,

I'm currently working on functionality to add additional universes at runtime. Would you be interested in receiving a PR for this and if so, do you have preference for a particular naming convention?

Cheers

@push-pop
Copy link

push-pop commented Sep 3, 2021

hi @TyIsI I am currently working on trying to add multi-universe multicast support for my WLED setup. Wondering if your code is somewhere I could look at? Or have any tips?

@TyIsI
Copy link
Author

TyIsI commented Sep 16, 2021

This is what I've added:

/////////////////////////////////////////////////////////
//
// Add and remove additional universes - Public
//
/////////////////////////////////////////////////////////

void ESPAsyncE131::addUniverse(uint16_t universe)
{
    delay(100);

    ip4_addr_t ifaddr;
    ip4_addr_t multicast_addr;

    ifaddr.addr = static_cast<uint32_t>(WiFi.localIP());
    multicast_addr.addr = static_cast<uint32_t>(IPAddress(239, 255,
                                                          ((universe >> 8) & 0xff), ((universe >> 0) & 0xff)));
    igmp_joingroup(&ifaddr, &multicast_addr);
}

void ESPAsyncE131::removeUniverse(uint16_t universe)
{
    delay(100);

    ip4_addr_t ifaddr;
    ip4_addr_t multicast_addr;

    ifaddr.addr = static_cast<uint32_t>(WiFi.localIP());
    multicast_addr.addr = static_cast<uint32_t>(IPAddress(239, 255,
                                                          ((universe >> 8) & 0xff), ((universe >> 0) & 0xff)));
    igmp_leavegroup(&ifaddr, &multicast_addr);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants