@brief Result of a write operation @details Indicates success or failure of write operation. Use fl::Spi::wait() to block until complete.
| 11 | /// @brief Result of a write operation |
| 12 | /// @details Indicates success or failure of write operation. Use fl::Spi::wait() to block until complete. |
| 13 | struct WriteResult { |
| 14 | bool ok; ///< True if write succeeded, false if error |
| 15 | fl::string error; ///< Error message (empty if ok == true) |
| 16 | |
| 17 | WriteResult() FL_NOEXCEPT : ok(true) {} |
| 18 | explicit WriteResult(const char* err) : ok(false), error(err) {} |
| 19 | explicit WriteResult(const fl::string& err) : ok(false), error(err) {} |
| 20 | |
| 21 | /// @brief Implicit conversion to bool for easy checking |
| 22 | operator bool() const { return ok; } |
| 23 | }; |
| 24 | |
| 25 | } // namespace fl |