A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Fri May 05 17:44:16 2017 +0000
Revision:
14:e75a59c1123d
Child:
33:714a0345e59b
Made IP addresses and ports available to debug messages

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 14:e75a59c1123d 1 #include "mbed.h"
andrewboyson 14:e75a59c1123d 2 #include "ip.h"
andrewboyson 14:e75a59c1123d 3
andrewboyson 14:e75a59c1123d 4 void IpProtocolToString(uint8_t protocol, int size, char* text)
andrewboyson 14:e75a59c1123d 5 {
andrewboyson 14:e75a59c1123d 6 switch (protocol)
andrewboyson 14:e75a59c1123d 7 {
andrewboyson 14:e75a59c1123d 8 case ICMP: strncpy (text, "ICMP", size); break;
andrewboyson 14:e75a59c1123d 9 case IGMP: strncpy (text, "IGMP", size); break;
andrewboyson 14:e75a59c1123d 10 case ICMP6: strncpy (text, "ICMP6", size); break;
andrewboyson 14:e75a59c1123d 11 case TCP: strncpy (text, "TCP" , size); break;
andrewboyson 14:e75a59c1123d 12 case UDP: strncpy (text, "UDP" , size); break;
andrewboyson 14:e75a59c1123d 13 default: snprintf(text, size, "%d", protocol); break;
andrewboyson 14:e75a59c1123d 14 }
andrewboyson 14:e75a59c1123d 15 }