-
Notifications
You must be signed in to change notification settings - Fork 7.6k
This is a continuation on the topic of adding IPv6 Support to ESP32 Arduino #9016
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
Changes from 1 commit
7b42a93
12be369
5987211
b8cc73c
305d276
41fb1a1
b37ce6c
e333afb
c7e63e6
55aaa6f
c4f366c
701d35f
a1b3f16
cb381f2
726496c
9012f64
58520a7
aad1041
04a2034
a2a6bd8
1fb442d
0df3aaa
4161873
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
#include "Printable.h" | ||
#include "WString.h" | ||
#include "lwip/ip_addr.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be better to have a separate IPAddressConverter class, that converts to & from LWIP? That would mean you don't need the dependency here. Just an idea. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't it make more sense to have a constructor accepting the LWIP implementation and some set/get-functions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's keep it now as it is. It has the conversion methods and is not a big deal to make them used in constructors, but I would rather not pollute the class with non-Arduino things. |
||
#include "esp_netif_ip_addr.h" | ||
|
||
#define IPADDRESS_V4_BYTES_INDEX 12 | ||
#define IPADDRESS_V4_DWORD_INDEX 3 | ||
|
@@ -93,16 +94,17 @@ class IPAddress : public Printable { | |
IPAddress& operator=(const IPAddress& address); | ||
|
||
virtual size_t printTo(Print& p) const; | ||
size_t printTo(Print& p, bool includeZone) const; | ||
String toString(bool includeZone = false) const; | ||
|
||
IPType type() const { return _type; } | ||
|
||
uint8_t zone() const { return (type() == IPv6)?_zone:0; } | ||
|
||
// LwIP conversions | ||
// Espresif LwIP conversions | ||
IPAddress(const ip_addr_t *addr); | ||
void to_ip_addr_t(ip_addr_t* addr) const; | ||
IPAddress& from_ip_addr_t(ip_addr_t* addr); | ||
IPAddress& from_ip_addr_t(const ip_addr_t* addr); | ||
esp_ip6_addr_type_t addr_type(); | ||
P-R-O-C-H-Y marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uint8_t zone() const { return (type() == IPv6)?_zone:0; } | ||
size_t printTo(Print& p, bool includeZone) const; | ||
|
||
friend class UDP; | ||
friend class Client; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this function then be named
ip6_addr_type()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TD-er we are procrastinating at this point... I like it the way it is. This PR needs to be merged already so we can progress further. Let's not get overly picky?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just mentioned it as it is a "breaking change" whenever it needs to be changed after this has been merged.
Also shouldn't it be a
const
function?Or does the Espressif code prohibit this (maybe you could use a
const_cast
)Anyway, do you plan on making a follow-up on this topic after it is merged?
I get it that this is blocking for your other PR with the network rework, so I do see the need for a quick merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can revisit everything after the overhaul. Let's get to use it a bit and see what would need adjusting.