EtherCard
EtherCard copied to clipboard
Ip
[IP] use IP header instead of array offsets
Description
-
less error prone
-
decrease code size to flash (save some bytes, see below)
-
introduce ethernet_header(), ethernet_payload(), ip_header(), ip_payload().... basic functions to retrieve headers and payloads
-
use ntoh and hton instead of manual multibytes adaptations. getBigEndianLong has been replaced by standard function ntohl.
Code size evolution depending on examples
Negative value: save size Positive value: increase size
test | old program size | old data size | new program size | new data size | program size delta | data size delta |
---|---|---|---|---|---|---|
backSoon | 8074 | 939 | 8100 | 939 | 26 | 0 |
getDHCPandDNS | 10358 | 1246 | 10326 | 1246 | -32 | 0 |
getStaticIP | 9676 | 827 | 9674 | 827 | -2 | 0 |
getViaDNS | 10206 | 820 | 10168 | 820 | -38 | 0 |
multipacket | 7740 | 1279 | 7730 | 1279 | -10 | 0 |
nanether | 8034 | 1093 | 8020 | 1093 | -14 | 0 |
noipClient | 14706 | 1357 | 14666 | 1355 | -40 | -2 |
notifyMyAndroid | 11238 | 1656 | 11204 | 1656 | -34 | 0 |
ntpClient | 9018 | 865 | 8984 | 865 | -34 | 0 |
persistence | 10910 | 823 | 10838 | 823 | -72 | 0 |
pings | 10110 | 1146 | 10054 | 1146 | -56 | 0 |
rbbb_server | 8514 | 881 | 8522 | 881 | 8 | 0 |
SSDP | 9244 | 1153 | 9220 | 1153 | -24 | 0 |
stashTest | 7152 | 539 | 7152 | 539 | 0 | 0 |
testDHCP | 7818 | 1099 | 7808 | 1101 | -10 | 2 |
testDHCPOptions | 7942 | 1113 | 7948 | 1113 | 6 | 0 |
thingspeak | 14776 | 1380 | 14744 | 1380 | -32 | 0 |
11122 | 1386 | 11086 | 1386 | -36 | 0 | |
udpClientSendOnly | 8452 | 1156 | 8426 | 1156 | -26 | 0 |
udpListener | 8380 | 964 | 8376 | 964 | -4 | 0 |
webClient | 10346 | 1164 | 10314 | 1164 | -32 | 0 |
xively | 14838 | 1058 | 14806 | 1058 | -32 | 0 |