Skip to content

Add several constants needed to use multicast UDP #8306

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

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

jepler
Copy link

@jepler jepler commented Aug 21, 2023

This was verified by @todbot to work on esp32 s2 and s3; the constant should match any system that uses LWIP numbering.

It enables use of multicast UDP and gets rid of the need for this block in https://github.com/todbot/CircuitPython_MicroOSC/blob/main/microosc.py#L55:

if impl == "circuitpython":
    # these defines are not yet in CirPy socket, known to work for ESP32 native WiFI
    IPPROTO_IP = 0  # super secret from @jepler
    IP_MULTICAST_TTL = 5  # super secret from @jepler
else:
    import socket
    IPPROTO_IP = socket.IPPROTO_IP
    IP_MULTICAST_TTL = socket.IP_MULTICAST_TTL

@dhalbert
Copy link
Collaborator

Maybe add this to 8.2.x?

This was verified by @todbot to work on esp32 s2 and s3;
the constant should match any system that uses LWIP numbering.
@jepler jepler force-pushed the setsockopt-constants-for-todbot branch from d08f006 to d23ddff Compare August 21, 2023 21:20
@jepler jepler changed the base branch from main to 8.2.x August 21, 2023 21:20
@jepler
Copy link
Author

jepler commented Aug 21, 2023

re-worked to apply to 8.2.x.

@todbot
Copy link

todbot commented Aug 21, 2023

awww thanks

Copy link
Member

@gamblor21 gamblor21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the values are correct and was able to build/test (UM FeatherS2):

import socketpool
socketpool.SocketPool.IPPROTO_IP
0
socketpool.SocketPool.IP_MULTICAST_TTL
5

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

Successfully merging this pull request may close these issues.

4 participants