mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
SITL: JSON: don't warn for none required sections
This commit is contained in:
parent
2bc7d17e7a
commit
f350bfba78
@ -136,7 +136,10 @@ uint16_t JSON::parse_sensors(const char *json)
|
|||||||
const char *p = strstr(json, key.section);
|
const char *p = strstr(json, key.section);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
// we don't have this sensor
|
// we don't have this sensor
|
||||||
printf("Failed to find %s\n", key.section);
|
if (key.required) {
|
||||||
|
printf("Failed to find %s\n", key.section);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
p += strlen(key.section)+1;
|
p += strlen(key.section)+1;
|
||||||
@ -147,9 +150,8 @@ uint16_t JSON::parse_sensors(const char *json)
|
|||||||
if (key.required) {
|
if (key.required) {
|
||||||
printf("Failed to find key %s/%s\n", key.section, key.key);
|
printf("Failed to find key %s/%s\n", key.section, key.key);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// record the keys that are found
|
// record the keys that are found
|
||||||
|
Loading…
Reference in New Issue
Block a user