mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
batmon: switch to battery_info.serial_number
This commit is contained in:
parent
2237bfa9a9
commit
3ec684153a
@ -191,7 +191,6 @@ void Batmon::RunImpl()
|
||||
if (ret == PX4_OK) {
|
||||
new_report.capacity = _batt_capacity;
|
||||
new_report.cycle_count = _cycle_count;
|
||||
new_report.serial_number = _serial_number;
|
||||
new_report.max_cell_voltage_delta = _max_cell_voltage_delta;
|
||||
new_report.cell_count = _cell_count;
|
||||
new_report.state_of_health = _state_of_health;
|
||||
@ -220,6 +219,12 @@ void Batmon::RunImpl()
|
||||
orb_publish_auto(ORB_ID(battery_status), &_batt_topic, &new_report, &instance);
|
||||
|
||||
_last_report = new_report;
|
||||
|
||||
battery_info_s battery_info{};
|
||||
battery_info.timestamp = new_report.timestamp;
|
||||
battery_info.id = new_report.id;
|
||||
snprintf(battery_info.serial_number, sizeof(battery_info.serial_number), "%" PRIu16, _serial_number);
|
||||
orb_publish_auto(ORB_ID(battery_info), &_battery_info_topic, &battery_info, &instance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user