/*
 *  Copyright 2020-2023 Yuntu Microelectronics co.,ltd
 *  All rights reserved.
 *
 *  YUNTU Confidential. This software is owned or controlled by YUNTU and may only be
 *  used strictly in accordance with the applicable license terms. By expressly
 *  accepting such terms or by downloading, installing, activating and/or otherwise
 *  using the software, you are agreeing that you have read, and that you agree to
 *  comply with and are bound by, such license terms. If you do not agree to be
 *  bound by the applicable license terms, then you may not retain, install,
 *  activate or otherwise use the software. The production use license in
 *  Section 2.3 is expressly granted for this software.
 *
 * @file common.h
 * @brief
 *
 */

#ifndef COMMON_H
#define COMMON_H

#ifdef __cplusplus
extern "C" {
#endif

/*==================================================================================================
                                              INCLUDE FILES
==================================================================================================*/
#include "stdint.h"

/*==================================================================================================
                                        FUNCTION PROTOTYPES
==================================================================================================*/

/**
 * @brief Print buffer data.
 *
 * @param[in] title: The title of the buffer.
 * @param[in] buf: The buffer data.
 * @param[in] len: The length of the buffer.
 * @return None.
 */
void print_buf(const char *title, const uint8_t *buf, size_t len);

/**
 * @brief Compare two buffers.
 *
 * @param[in] buf1: The first buffer.
 * @param[in] buf2: The second buffer.
 * @param[in] len: The length of the buffer.
 *
 * @return  int : The result of the comparison.
 * @retval  0: The two buffers are the same.
 * @retval -1: The two buffers are different.
 */
int buf_cmp(const uint8_t *buf1, const uint8_t *buf2, size_t len);

#ifdef __cplusplus
}
#endif

#endif /* End of file common.h */
