mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 13:10:08 +00:00
[otns] add default implementation for otPlatOtnsStatus (#5155)
This commit adds a default implementation for otPlatOtnsStatus, which emits OTNS status messages to log, so that OTNS=1 could be used with real devices. This is required for the Silk-OTNS integration work, as Silk will pick up these messages and reroute them to OTNS for visualization purposes.
This commit is contained in:
@@ -1158,6 +1158,19 @@ extern "C" {
|
||||
#define otLogDebgPlat(...)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def otLogOtns
|
||||
*
|
||||
* This method generates a log with level none for the Core region,
|
||||
* and is specifically for OTNS visualization use.
|
||||
*
|
||||
* @param[in] ... Arguments for the format specification.
|
||||
*
|
||||
*/
|
||||
#if (OPENTHREAD_MTD || OPENTHREAD_FTD) && OPENTHREAD_CONFIG_OTNS_ENABLE
|
||||
#define otLogOtns(...) _otLogFormatter(OT_LOG_LEVEL_NONE, OT_LOG_REGION_CORE, _OT_LEVEL_NONE_PREFIX __VA_ARGS__, NULL)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def otDumpCrit
|
||||
*
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
#include "common/debug.hpp"
|
||||
#include "common/locator-getters.hpp"
|
||||
#include "common/logging.hpp"
|
||||
|
||||
namespace ot {
|
||||
namespace Utils {
|
||||
@@ -133,4 +134,9 @@ void Otns::EmitNeighborChange(otNeighborTableEvent aEvent, Neighbor &aNeighbor)
|
||||
} // namespace Utils
|
||||
} // namespace ot
|
||||
|
||||
OT_TOOL_WEAK void otPlatOtnsStatus(const char *aStatus)
|
||||
{
|
||||
otLogOtns("[OTNS] %s", aStatus);
|
||||
}
|
||||
|
||||
#endif // (OPENTHREAD_MTD || OPENTHREAD_FTD) && OPENTHREAD_CONFIG_OTNS_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user