dsuarezv / mavlink.net

A better MavLink object generation for C#. Richer message classes are generated from the object definitions.
39 stars 35 forks source link

Possible bug in mavlinkgen #3

Closed haakoo closed 10 years ago

haakoo commented 10 years ago

I got Mavlink.net working now, and I tried to decode the UasHeartBeat message, and look at the fields of the message. When I came to the MavState field, I didn't get a proper value. I looked in the Generated messages and found that MavState is bugged, all the enum constants/options are assigned to 0 (zero).

I guess the reason is that only the first one in common.xml are given a value (zero) and the remaining is not. I'm not sure if this is only for Mav_State, or if it's also other enums in the definitions.

Should MavLink.Net auto assign numbers, or should this be fixed in the definition?

haakoo commented 10 years ago

I found the same repeating itself for two more enums (MAVLINK_DATA_STREAM_TYPE and MAV_CMD_ACK). They do not have designated values in the common.xml definition, and the resulting generated code give all options value 0 (zero).

Do you know if this is something mavlinkgen should handle, or should I modify common.xml?

I've also asked directly to the mavlink repo.

dsuarezv commented 10 years ago

This is a case that mavlinkgen should handle. I guess I overlooked it.

I'll try to get it fixed as soon as I get some time to play with it.

Thanks for pointing it out.