mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/ble_mesh_bt_hex' into 'master'
ble_mesh: Fix wrong log output with bt_hex See merge request espressif/esp-idf!9119
This commit is contained in:
commit
1420b6dd89
@ -17,11 +17,16 @@
|
|||||||
const char *bt_hex(const void *buf, size_t len)
|
const char *bt_hex(const void *buf, size_t len)
|
||||||
{
|
{
|
||||||
static const char hex[] = "0123456789abcdef";
|
static const char hex[] = "0123456789abcdef";
|
||||||
static char str[129];
|
static char hexbufs[2][129];
|
||||||
|
static u8_t curbuf;
|
||||||
const u8_t *b = buf;
|
const u8_t *b = buf;
|
||||||
|
char *str = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
len = MIN(len, (sizeof(str) - 1) / 2);
|
str = hexbufs[curbuf++];
|
||||||
|
curbuf %= ARRAY_SIZE(hexbufs);
|
||||||
|
|
||||||
|
len = MIN(len, (sizeof(hexbufs[0]) - 1) / 2);
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
str[i * 2] = hex[b[i] >> 4];
|
str[i * 2] = hex[b[i] >> 4];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user