sizes in int

This commit is contained in:
giomba 2019-12-23 19:02:05 +01:00
parent 11e56ac38c
commit 3d3d24942e
4 changed files with 8 additions and 8 deletions

4
ipv6.h
View File

@ -38,10 +38,10 @@ namespace ipv6 {
void setSrcAddress(IPv6Addr& address); void setSrcAddress(IPv6Addr& address);
void setDstAddress(IPv6Addr& address); void setDstAddress(IPv6Addr& address);
void setNextHeader(uint8_t next_header); void setNextHeader(uint8_t next_header);
void setPayload(char* payload, uint8_t len); void setPayload(char* payload, int len);
char* serialize(); char* serialize();
void deserialize(const char*, uint8_t len); void deserialize(const char*, int len);
void doAction(); void doAction();
}; };

View File

@ -64,7 +64,7 @@ char* IPv6Packet::serialize() { /* do we actually need these function? everythin
return packet; return packet;
} }
void IPv6Packet::deserialize(const char* buffer, uint8_t len) { void IPv6Packet::deserialize(const char* buffer, int len) {
memcpy(packet, buffer, len); memcpy(packet, buffer, len);
} }
@ -79,7 +79,7 @@ void IPv6Packet::setDstAddress(IPv6Addr& address) {
memcpy(packet + 24, (void*)&address, 16); memcpy(packet + 24, (void*)&address, 16);
} }
void IPv6Packet::setPayload(char* payload, uint8_t len) { void IPv6Packet::setPayload(char* payload, int len) {
memset(packet, 0, LEN); memset(packet, 0, LEN);
ipv6_packet_header* header = (ipv6_packet_header*)packet; ipv6_packet_header* header = (ipv6_packet_header*)packet;

4
slip.h
View File

@ -8,8 +8,8 @@ namespace slip {
const char ESC_END = 0xdc; const char ESC_END = 0xdc;
const char ESC_ESC = 0xdd; const char ESC_ESC = 0xdd;
void send(const char* buffer, uint8_t len); void send(const char* buffer, int len);
int recv(char* buffer, uint8_t len); int recv(char* buffer, int len);
} }

View File

@ -1,6 +1,6 @@
namespace slip { namespace slip {
void send(const char* buffer, uint8_t len) { void send(const char* buffer, int len) {
// Serial.write(END); /* frame-out any possible noise on the line */ // Serial.write(END); /* frame-out any possible noise on the line */
for (uint8_t i = 0; i < len; ++i) { for (uint8_t i = 0; i < len; ++i) {
@ -22,7 +22,7 @@ namespace slip {
Serial.write(END); Serial.write(END);
} }
int recv(char* buffer, uint8_t len) { int recv(char* buffer, int len) {
char r; char r;
uint8_t i = 0; uint8_t i = 0;