mirror of
https://github.com/espressif/openthread.git
synced 2026-10-13 03:07:41 +00:00
[error] add 'ot::Error' and 'kError{Name}' for use by core modules (#6237)
This commit adds a new core header files `common/error.hpp` which
defines `ot::Error` (mirroring `otError`) and `kError{Name}` constants
(mirroring the public `OT_ERROR_{NAME}` definitions). The new (C++
style) definitions are used by core modules. This commit also moves
`otThreadErrorToString()` (from `logging.hpp` to `error.hpp`) and
renames it to `ErrorToString()` which is used as the internal (to
core) function to covert an `Error` to a string.
This commit is contained in:
@@ -197,7 +197,7 @@ void TestUdpMessageChecksum(void)
|
||||
|
||||
CorruptMessage(*message);
|
||||
|
||||
VerifyOrQuit(Checksum::VerifyMessageChecksum(*message, messageInfo, Ip6::kProtoUdp) != OT_ERROR_NONE,
|
||||
VerifyOrQuit(Checksum::VerifyMessageChecksum(*message, messageInfo, Ip6::kProtoUdp) != kErrorNone,
|
||||
"Checksum passed on corrupted message");
|
||||
|
||||
message->Free();
|
||||
@@ -271,7 +271,7 @@ void TestIcmp6MessageChecksum(void)
|
||||
|
||||
CorruptMessage(*message);
|
||||
|
||||
VerifyOrQuit(Checksum::VerifyMessageChecksum(*message, messageInfo, Ip6::kProtoIcmp6) != OT_ERROR_NONE,
|
||||
VerifyOrQuit(Checksum::VerifyMessageChecksum(*message, messageInfo, Ip6::kProtoIcmp6) != kErrorNone,
|
||||
"Checksum passed on corrupted message");
|
||||
|
||||
message->Free();
|
||||
|
||||
Reference in New Issue
Block a user