mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 20:17:34 +08:00
param_shmem import: don't fail on type mismatch
This commit is contained in:
@@ -1170,7 +1170,8 @@ param_import_callback(bson_decoder_t decoder, void *private, bson_node_t node)
|
||||
switch (node->type) {
|
||||
case BSON_INT32:
|
||||
if (param_type(param) != PARAM_TYPE_INT32) {
|
||||
PX4_DEBUG("unexpected type for '%s", node->name);
|
||||
PX4_WARN("unexpected type for %s", node->name);
|
||||
result = 1; // just skip this entry
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1181,7 +1182,8 @@ param_import_callback(bson_decoder_t decoder, void *private, bson_node_t node)
|
||||
|
||||
case BSON_DOUBLE:
|
||||
if (param_type(param) != PARAM_TYPE_FLOAT) {
|
||||
PX4_DEBUG("unexpected type for '%s", node->name);
|
||||
PX4_WARN("unexpected type for %s", node->name);
|
||||
result = 1; // just skip this entry
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1192,12 +1194,14 @@ param_import_callback(bson_decoder_t decoder, void *private, bson_node_t node)
|
||||
|
||||
case BSON_BINDATA:
|
||||
if (node->subtype != BSON_BIN_BINARY) {
|
||||
PX4_DEBUG("unexpected subtype for '%s", node->name);
|
||||
PX4_WARN("unexpected type for %s", node->name);
|
||||
result = 1; // just skip this entry
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (bson_decoder_data_pending(decoder) != param_size(param)) {
|
||||
PX4_DEBUG("bad size for '%s'", node->name);
|
||||
PX4_WARN("bad size for '%s'", node->name);
|
||||
result = 1; // just skip this entry
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user