mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
Move printBytes to meshUtils (#4424)
This commit is contained in:
parent
a7da3537e2
commit
c6a9edf8c7
@ -7,6 +7,7 @@
|
||||
#include "configuration.h"
|
||||
#include "main.h"
|
||||
#include "mesh-pb-constants.h"
|
||||
#include "meshUtils.h"
|
||||
#include "modules/RoutingModule.h"
|
||||
#if !MESHTASTIC_EXCLUDE_MQTT
|
||||
#include "mqtt/MQTT.h"
|
||||
@ -188,14 +189,6 @@ ErrorCode Router::sendLocal(meshtastic_MeshPacket *p, RxSource src)
|
||||
}
|
||||
}
|
||||
|
||||
void printBytes(const char *label, const uint8_t *p, size_t numbytes)
|
||||
{
|
||||
LOG_DEBUG("%s: ", label);
|
||||
for (size_t i = 0; i < numbytes; i++)
|
||||
LOG_DEBUG("%02x ", p[i]);
|
||||
LOG_DEBUG("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a packet on a suitable interface. This routine will
|
||||
* later free() the packet to pool. This routine is not allowed to stall.
|
||||
|
@ -56,4 +56,12 @@ char *strnstr(const char *s, const char *find, size_t slen)
|
||||
s--;
|
||||
}
|
||||
return ((char *)s);
|
||||
}
|
||||
|
||||
void printBytes(const char *label, const uint8_t *p, size_t numbytes)
|
||||
{
|
||||
LOG_DEBUG("%s: ", label);
|
||||
for (size_t i = 0; i < numbytes; i++)
|
||||
LOG_DEBUG("%02x ", p[i]);
|
||||
LOG_DEBUG("\n");
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
#pragma once
|
||||
#include "DebugConfiguration.h"
|
||||
#include <stdint.h>
|
||||
|
||||
/// C++ v17+ clamp function, limits a given value to a range defined by lo and hi
|
||||
template <class T> constexpr const T &clamp(const T &v, const T &lo, const T &hi)
|
||||
|
Loading…
Reference in New Issue
Block a user