| 202 | } // namespace OtaUpgrade |
| 203 | |
| 204 | String toString(OtaUpgrade::BasicStream::Error code) |
| 205 | { |
| 206 | using Error = OtaUpgrade::BasicStream::Error; |
| 207 | switch(code) { |
| 208 | case Error::None: |
| 209 | return nullptr; |
| 210 | case Error::InvalidFormat: |
| 211 | return F("Invalid/Unrecognized upgrade image format"); |
| 212 | case Error::UnsupportedData: |
| 213 | return F("Upgrade image contains unsupported extended data."); |
| 214 | case Error::DecryptionFailed: |
| 215 | return F("Upgrade image decryption failed."); |
| 216 | case Error::NoRomFound: |
| 217 | return F("No suitable ROM image found"); |
| 218 | case Error::RomTooLarge: |
| 219 | return F("ROM image too large"); |
| 220 | case Error::DowngradeNotAllowed: |
| 221 | return F("Downgrade not allowed"); |
| 222 | case Error::VerificationFailed: |
| 223 | return F("Signature/Checksum verification failed"); |
| 224 | case Error::FlashWriteFailed: |
| 225 | return F("Error while writing Flash memory"); |
| 226 | case Error::RomActivationFailed: |
| 227 | return F("Could not activate updated ROM"); |
| 228 | case Error::OutOfMemory: |
| 229 | return F("Out of memory. Allocation failed."); |
| 230 | case Error::Internal: |
| 231 | return F("Internal error"); |
| 232 | default: |
| 233 | return F("<unknown error>"); |
| 234 | } |
| 235 | } |
no test coverage detected