Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension properties not generated with emit-extensions enabled #297

Open
sachaw opened this issue Feb 10, 2025 · 1 comment
Open

Extension properties not generated with emit-extensions enabled #297

sachaw opened this issue Feb 10, 2025 · 1 comment

Comments

@sachaw
Copy link

sachaw commented Feb 10, 2025

Hi, I am trying to consume a BATTERY_STATUS message which has several extension fields.
the codegen looks like this:

pub struct BATTERY_STATUS_DATA {
    pub current_consumed: i32,
    pub energy_consumed: i32,
    pub temperature: i16,
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub voltages: [u16; 10],
    pub current_battery: i16,
    pub id: u8,
    pub battery_function: MavBatteryFunction,
    pub mavtype: MavBatteryType,
    pub battery_remaining: i8,
}

Take the extension field fault_bitmask which is not generated, however the MavBatteryFault enum is

pub enum MavBatteryFault {
    MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1,
    MAV_BATTERY_FAULT_SPIKES = 2,
    MAV_BATTERY_FAULT_CELL_FAIL = 4,
    MAV_BATTERY_FAULT_OVER_CURRENT = 8,
    MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16,
    MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32,
    MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64,
    MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128,
    BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256,
}

Not sure if i'm missing something, but some assistance would be appreciated.
Thanks.

@pv42
Copy link
Contributor

pv42 commented Feb 10, 2025

See #246 and #248

It is fixed on master but there is no released version with this fix now.
You will have to depend on a git version for now until #274 gets resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants