Cordio Stack and Cordio Profiles  r2p3-02rel0
wstr.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file wstr.h
4  *
5  * \brief String manipulation functions.
6  *
7  * Copyright (c) 2014-2018 Arm Ltd. All Rights Reserved.
8  * ARM Ltd. confidential and proprietary.
9  *
10  * IMPORTANT. Your use of this file is governed by a Software License Agreement
11  * ("Agreement") that must be accepted in order to download or otherwise receive a
12  * copy of this file. You may not use or copy this file for any purpose other than
13  * as described in the Agreement. If you do not agree to all of the terms of the
14  * Agreement do not use this file and delete all copies in your possession or control;
15  * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior
16  * to any use, copying or further distribution of this software.
17  */
18 /*************************************************************************************************/
19 
20 #ifndef WSTR_H
21 #define WSTR_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*! \addtogroup WSF_UTIL_API
28  * \{ */
29 
30 /*************************************************************************************************/
31 /*!
32  * \brief Copies a string up to a given length.
33  *
34  * \param pBuf Pointer to buffer to copy to.
35  * \param pData Pointer to the string to copy.
36  * \param n Size of pBuf in bytes.
37  *
38  * \return none.
39  */
40 /*************************************************************************************************/
41 void WstrnCpy(char *pBuf, const char *pData, uint8_t n);
42 
43 /*************************************************************************************************/
44 /*!
45  * \brief Byte by byte reverse and copy a buffer.
46  *
47  * \param pBuf1 Buffer to hold reversed copy.
48  * \param pBuf2 Buffer to copy.
49  * \param len Size of pBuf1 and pBuf2 in bytes.
50  *
51  * \return None.
52  */
53 /*************************************************************************************************/
54 void WStrReverseCpy(uint8_t *pBuf1, const uint8_t *pBuf2, uint16_t len);
55 
56 /*************************************************************************************************/
57 /*!
58  * \brief Byte by byte reverse a buffer.
59  *
60  * \param pBuf Buffer to reverse.
61  * \param len size of pBuf in bytes.
62  *
63  * \return None.
64  */
65 /*************************************************************************************************/
66 void WStrReverse(uint8_t *pBuf, uint8_t len);
67 
68 /*************************************************************************************************/
69 /*!
70  * \brief Format a hex value.
71  *
72  * \param pBuf Storage for string representation of value.
73  * \param val Value.
74  * \param len Length of value, in bits.
75  *
76  * \return None.
77  */
78 /*************************************************************************************************/
79 void WStrFormatHex(char *pBuf, uint32_t val, uint8_t len);
80 
81 /*! \} */ /* WSF_UTIL_API */
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /* WSTR_H */
void WStrReverseCpy(uint8_t *pBuf1, const uint8_t *pBuf2, uint16_t len)
Byte by byte reverse and copy a buffer.
void WStrFormatHex(char *pBuf, uint32_t val, uint8_t len)
Format a hex value.
unsigned long uint32_t
Unsigned 32-bit value.
Definition: wsf_types.h:71
void WstrnCpy(char *pBuf, const char *pData, uint8_t n)
Copies a string up to a given length.
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
void WStrReverse(uint8_t *pBuf, uint8_t len)
Byte by byte reverse a buffer.