I am trying to control a quadrotor device, and to do so I need my program to send command inputs via a struct. In the owner's manual, it oultines how to do this:
struct CTRL_INPUT {
short pitch;
short roll;
short yaw;
short thrust;
short ctrl;
short chksum;
};
struct CTRL_INPUT CTRL_Input;
My problem is, chksum is declared as a short but then gets 0xAAAA added to it, which corresponds to a value of 43690, much larger than a short can be. I'm pretty sure its meant to be a signed short, as it being 'unsigned' was not specified in the code. Further, the values for pitch, roll, and yaw can be negative, so they are most definitely signed. Is 0xAAAA not what I think it is? Is it not meant to be there in implementation? I'm a newb when it comes to structs (most of C++ actually), so any help is much appreciated.