ArduinoJson: API Reference

JsonVariant::success()

Description

Tells whether the variant contains a value.

Signature
bool success() const;
Return value
  • true if the variant contains a value,
  • false if the variant is empty or invalid.
Example
JsonVariant variant;
bool beforeAssign = variant.success(); // false
variant = 42;
bool afterAssign = variant.success(); // true
Fork me on GitHub