Any IPv4 address can be represented as a string between 16 (15 + '\0') and 8 (7 + '\0') characters :
1.1.1.1 -> 7 + 1 characters.
255.255.255.255 -> 15 + 1 characters.
Memory fragmentation due to String allocation can cause crash or undefined behaviors in microcontrollers. This is especially true for very constrained device like the atmega328p in the Arduino Uno.
This PR address this issue by changing the type of ipaddress to char[16], allowing for static memory allocation.
int -> string conversion is then handled by sprintf().
Any IPv4 address can be represented as a string between 16 (15 + '\0') and 8 (7 + '\0') characters :
Memory fragmentation due to String allocation can cause crash or undefined behaviors in microcontrollers. This is especially true for very constrained device like the atmega328p in the Arduino Uno.
This PR address this issue by changing the type of
ipaddress
tochar[16]
, allowing for static memory allocation. int -> string conversion is then handled bysprintf()
.