Commit 6328bcdf authored by Martin Vítek's avatar Martin Vítek

Add pointer overload

parent 6de7a562
......@@ -15,7 +15,7 @@ class MAC
memset(mac, 0, sizeof(mac));
}
MAC(uint8_t (&mac)[6])
MAC(const uint8_t (&mac)[6])
{
memcpy(this->mac, mac, sizeof(this->mac));
}
......@@ -29,7 +29,7 @@ class MAC
uint8_t* operator=(const uint8_t* mac)
{
memcpy(this->mac, mac, sizeof(mac));
memcpy(this->mac, mac, 6);
return this->mac;
}
......@@ -106,6 +106,16 @@ class IP
return this->ip.array;
}
const uint8_t* operator=(const uint8_t* ip)
{
for (uint8_t i=0; i<4; i++)
{
this->ip.array[i] = ip[i];
}
return this->ip.array;
}
uint8_t operator[](const uint8_t index)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment