mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 16:48:29 -04:00
AP_Scripting: bindings: logging: add flag to copy format strings
This commit is contained in:
parent
1df00d879a
commit
1547c65ff3
@ -1187,9 +1187,9 @@ AP_Logger::log_write_fmt *AP_Logger::msg_fmt_for_name(const char *name, const ch
|
||||
memcpy((char*)ls_strings.format, f->fmt, MIN(sizeof(ls_strings.format), strlen(f->fmt)));
|
||||
memcpy((char*)ls_strings.labels, f->labels, MIN(sizeof(ls_strings.labels), strlen(f->labels)));
|
||||
if (f->units != nullptr) {
|
||||
memcpy((char*)ls_strings.units, f->units, MIN(sizeof(ls.units), strlen(f->units)));
|
||||
memcpy((char*)ls_strings.units, f->units, MIN(sizeof(ls_strings.units), strlen(f->units)));
|
||||
} else {
|
||||
memset((char*)ls_strings.units, '?', MIN(sizeof(ls.format), strlen(f->fmt)));
|
||||
memset((char*)ls_strings.units, '?', MIN(sizeof(ls_strings.format), strlen(f->fmt)));
|
||||
}
|
||||
if (f->mults != nullptr) {
|
||||
memcpy((char*)ls_strings.multipliers, f->mults, MIN(sizeof(ls_strings.multipliers), strlen(f->mults)));
|
||||
|
@ -130,7 +130,7 @@ int AP_Logger_Write(lua_State *L) {
|
||||
struct AP_Logger::log_write_fmt *f;
|
||||
if (!have_units) {
|
||||
// ask for a mesage type
|
||||
f = AP_logger->msg_fmt_for_name(name, label_cat, nullptr, nullptr, fmt_cat, true);
|
||||
f = AP_logger->msg_fmt_for_name(name, label_cat, nullptr, nullptr, fmt_cat, true, true);
|
||||
|
||||
} else {
|
||||
// read in units and multiplers strings
|
||||
@ -153,7 +153,7 @@ int AP_Logger_Write(lua_State *L) {
|
||||
strcat(multipliers_cat,multipliers);
|
||||
|
||||
// ask for a mesage type
|
||||
f = AP_logger->msg_fmt_for_name(name, label_cat, units_cat, multipliers_cat, fmt_cat, true);
|
||||
f = AP_logger->msg_fmt_for_name(name, label_cat, units_cat, multipliers_cat, fmt_cat, true, true);
|
||||
}
|
||||
|
||||
if (f == nullptr) {
|
||||
|
Loading…
Reference in New Issue
Block a user