Tasmota/lib/libesp32_div/ESP32-HomeKit/src/hexdump.c
2021-11-15 12:35:48 +01:00

35 lines
1021 B
C

// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <stdio.h>
//#define HEX_DBG_ENABLE
#ifdef HEX_DBG_ENABLE
void hex_dbg_with_name(const char *name, unsigned char *buf, int buf_len)
{
int i;
printf("%s: ", name);
for (i = 0; i < buf_len; i++) {
if (i % 16 == 0)
printf("\r\n");
printf("%02x ", buf[i]);
}
printf("\r\n");
}
#else
void hex_dbg_with_name(const char *name, unsigned char *buf, int buf_len)
{
}
#endif /* HEX_DBG_ENABLED */