From be885a44d45ee6afde15248c3b49437451cc92d1 Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Fri, 25 Mar 2022 17:08:56 -0800 Subject: [PATCH] updated from reviewer feedback, match data types to mavlink --- .../power/20008.SmartBatteryContinuous.uavcan | 25 +++++++++++-------- .../power/20009.SmartBatteryPeriodic.uavcan | 13 +++++----- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/ardupilot/equipment/power/20008.SmartBatteryContinuous.uavcan b/ardupilot/equipment/power/20008.SmartBatteryContinuous.uavcan index 8734f99..8c780aa 100644 --- a/ardupilot/equipment/power/20008.SmartBatteryContinuous.uavcan +++ b/ardupilot/equipment/power/20008.SmartBatteryContinuous.uavcan @@ -2,18 +2,21 @@ # Smart battery data to be sent continuously (10Hz or greater) # -float16 temperature # [Celsius] -float16 current # [Ampere] -float16 voltage # [Volt] -uint8 remaining # [Percent] -uint16 status # [Bitmask] +int16_t temperature # [cdegC] +int16_t current # [cA] +uint16_t voltage # [mV] +int8 battery_remaining # [%] +int32 time_remaining # [s] +uint32 status_flags uint16 STATUS_FLAG_IN_USE = 1 uint16 STATUS_FLAG_CHARGING = 2 uint16 STATUS_FLAG_OVER_TEMP = 4 -uint16 STATUS_FLAG_OVER_VOLT = 8 -uint16 STATUS_FLAG_OVER_CURRENT = 16 -uint16 STATUS_FLAG_CELL_IMBALANCE = 32 -uint16 STATUS_FLAG_PROTECTIONS_ENABLED = 64 -uint16 STATUS_FLAG_REQUIRES_SERVICE = 128 -uint16 STATUS_FLAG_ERROR_UNKNOWN = 256 +uint16 STATUS_FLAG_UNDER_TEMP = 8 +uint16 STATUS_FLAG_OVER_VOLT = 16 +uint16 STATUS_FLAG_OVER_CURRENT = 32 +uint16 STATUS_FLAG_CELL_IMBALANCE = 64 +uint16 STATUS_FLAG_PROTECTIONS_ENABLED = 128 +uint16 STATUS_FLAG_REQUIRES_SERVICE = 256 +uint16 STATUS_FLAG_BAD_BATTERY = 512 +uint16 STATUS_FLAG_ERROR_UNKNOWN = 32768 diff --git a/ardupilot/equipment/power/20009.SmartBatteryPeriodic.uavcan b/ardupilot/equipment/power/20009.SmartBatteryPeriodic.uavcan index 3593122..6bcad3e 100644 --- a/ardupilot/equipment/power/20009.SmartBatteryPeriodic.uavcan +++ b/ardupilot/equipment/power/20009.SmartBatteryPeriodic.uavcan @@ -2,11 +2,10 @@ # Smart battery data to be sent periodically (1Hz or less) # -uint8[<=32] name # Formatted as manufacturer_model, eg wattsinnovations_smartbattery -uint32 serial # Manufacturer serial number -uint8 state_of_health # [Percent] +uint8[<=50] name # Formatted as manufacturer_product, eg wattsinnovations_smartbattery +uint8[<=16] serial_number # Serial number in ASCII characters, 0 terminated +uint8[<=11] manufacture_date # Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated +int32 capacity_full_specification # [mAh] +int32 capacity_full # [mAh] uint16 cycle_count -uint16 time_remaining # [Seconds] -float16 design_capacity # [Watt hours] -float16 actual_capacity # [Watt hours] -float16[<=24] cell_voltages # [Volt] +uint16_t[<=24] cell_voltages # [mV]