/*
 *
 * (c) Copyright 2015 Samsung Research America, Inc.
 *                  All rights reserved
 *
 *                  MCL-B2B Lab
 *
 *
 * File: utils.h
 * Author: r.kadir@samsung.com
 * Creation Date: Apr, 2015
 *
 */
/**
* Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
*
* Mobile Platform & Solutions Lab (MPS Lab),
* Samsung Electronics Co., Ltd.
*
* This software and its documentation are confidential and proprietary
* information of Samsung Electronics Co., Ltd.  No part of the software and
* documents may be copied, reproduced, transmitted, translated, or reduced to
* any electronic medium or machine-readable form without the prior written
* consent of Samsung Electronics.
*
* Samsung Electronics makes no representations with respect to the contents,
* and assumes no responsibility for any errors that might appear in the
* software and documents. This publication and the contents hereof are subject
* to change without notice.
*/

#ifndef UTILS_H_
#define UTILS_H_

#include "tx.h"

void tobytes(
	uint8_t * hexstr,
	uint32_t hexstrlen,
	uint8_t * bytes
);

void tohexstring(
	uint8_t * bytes,
	int32_t byteslen,
	uint8_t * hexstring,
	uint8_t isUpper
);

uint8_t *fromhex(const char *str);

void utils_hex_to_bin(const char* str, unsigned char* out, int inLen, int* outLen);
void utils_bin_to_hex(unsigned char* bin_in, size_t inlen, char* hex_out, size_t outlen);

uint32_t safe_sprintf_append(uint16_t cur_len, uint16_t limit, char* str, const char* format, ...);

#endif /* UTILS_H_ */
