PhoenixPilot/PhoenixPilot — pull request #123 by peabody124 (2012-12-22 20:38:05+00:00)
Title: UAVO generator: Calculate the size of the object and embed it

This is a fix for the bug found in https://github.com/PhoenixPilot/PhoenixPilot/pull/119 where aligning the structures pads them at the end and increases the sizeof value. This changed the data representation in the UAVTalk packets which was bad.

Luckily the code was written to use the NUMBYTES field instead of sizeof, and so this was a fairly simple fix.

The downside is that sizeof still reports a different size than the on-the-wire size.

I tried adding the align attribute after the first field instead of the end of the structure but that doesn't fix the problem.