I have a known frame that I'm sending to a function which is making me crazy because the size of the frame when received on this function is 4, so I'm loosing a lot of data.
I'm using an ESP8266 board.
Honestly, if you would have fired up Google you would have found your answer way quicker. But to recap, sizeof() is done at compiler time. So in the function it returns the size of the local 'frame' (function argument), not the size of what you pass to that function. And because 'frame' is defined as "uint8_t frame[]" = "uint8_t* frame" aka it's a pointer which is 4 bytes on an ESP.
Solution, or work on the global variable (but then you would not be able to pass different variables) or pass the size to the function as well.
Thanks septillion.
I knew this subtlety but didn't notice the impact that could have here, thanks to your explanation I understand it.
Adding the size to the function parameter works well.