Caching the advertising data and the scan response.

Fork of MaximBLE by Maxim Integrated

Committer:
kgills
Date:
Tue Mar 22 18:16:10 2016 +0000
Revision:
1:4e764337d5c5
Parent:
0:b562096246b3
Caching the advertising data and scan response.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
enginerd 0:b562096246b3 1 /*************************************************************************************************/
enginerd 0:b562096246b3 2 /*!
enginerd 0:b562096246b3 3 * \file bda.h
enginerd 0:b562096246b3 4 *
enginerd 0:b562096246b3 5 * \brief Bluetooth device address utilities.
enginerd 0:b562096246b3 6 *
enginerd 0:b562096246b3 7 * $Date: 2012-05-08 10:58:07 -0700 (Tue, 08 May 2012) $
enginerd 0:b562096246b3 8 * $Revision: 316 $
enginerd 0:b562096246b3 9 *
enginerd 0:b562096246b3 10 * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
enginerd 0:b562096246b3 11 *
enginerd 0:b562096246b3 12 * SPDX-License-Identifier: LicenseRef-PBL
enginerd 0:b562096246b3 13 *
enginerd 0:b562096246b3 14 * Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use
enginerd 0:b562096246b3 15 * this file except in compliance with the License. You may obtain a copy of the License at
enginerd 0:b562096246b3 16 *
enginerd 0:b562096246b3 17 * https://www.mbed.com/licenses/PBL-1.0
enginerd 0:b562096246b3 18 *
enginerd 0:b562096246b3 19 * See the License for the specific language governing permissions and limitations under the License.
enginerd 0:b562096246b3 20 */
enginerd 0:b562096246b3 21 /*************************************************************************************************/
enginerd 0:b562096246b3 22 #ifndef BDA_H
enginerd 0:b562096246b3 23 #define BDA_H
enginerd 0:b562096246b3 24
enginerd 0:b562096246b3 25 #ifdef __cplusplus
enginerd 0:b562096246b3 26 extern "C" {
enginerd 0:b562096246b3 27 #endif
enginerd 0:b562096246b3 28
enginerd 0:b562096246b3 29 /**************************************************************************************************
enginerd 0:b562096246b3 30 Macros
enginerd 0:b562096246b3 31 **************************************************************************************************/
enginerd 0:b562096246b3 32
enginerd 0:b562096246b3 33 /*! BD address length */
enginerd 0:b562096246b3 34 #define BDA_ADDR_LEN 6
enginerd 0:b562096246b3 35
enginerd 0:b562096246b3 36 /*! BD address string length */
enginerd 0:b562096246b3 37 #define BDA_ADDR_STR_LEN (BDA_ADDR_LEN * 2)
enginerd 0:b562096246b3 38
enginerd 0:b562096246b3 39 /**************************************************************************************************
enginerd 0:b562096246b3 40 Data Types
enginerd 0:b562096246b3 41 **************************************************************************************************/
enginerd 0:b562096246b3 42
enginerd 0:b562096246b3 43 /*! BD address data type */
enginerd 0:b562096246b3 44 typedef uint8_t bdAddr_t[BDA_ADDR_LEN];
enginerd 0:b562096246b3 45
enginerd 0:b562096246b3 46 /**************************************************************************************************
enginerd 0:b562096246b3 47 Function Declarations
enginerd 0:b562096246b3 48 **************************************************************************************************/
enginerd 0:b562096246b3 49
enginerd 0:b562096246b3 50 /*************************************************************************************************/
enginerd 0:b562096246b3 51 /*!
enginerd 0:b562096246b3 52 * \fn BdaCpy
enginerd 0:b562096246b3 53 *
enginerd 0:b562096246b3 54 * \brief Copy a BD address from source to destination.
enginerd 0:b562096246b3 55 *
enginerd 0:b562096246b3 56 * \param pDst Pointer to destination.
enginerd 0:b562096246b3 57 * \param pSrc Pointer to source.
enginerd 0:b562096246b3 58 *
enginerd 0:b562096246b3 59 * \return None.
enginerd 0:b562096246b3 60 */
enginerd 0:b562096246b3 61 /*************************************************************************************************/
enginerd 0:b562096246b3 62 void BdaCpy(uint8_t *pDst, uint8_t *pSrc);
enginerd 0:b562096246b3 63
enginerd 0:b562096246b3 64
enginerd 0:b562096246b3 65 /*************************************************************************************************/
enginerd 0:b562096246b3 66 /*!
enginerd 0:b562096246b3 67 * \fn BdaCmp
enginerd 0:b562096246b3 68 *
enginerd 0:b562096246b3 69 * \brief Compare two BD addresses.
enginerd 0:b562096246b3 70 *
enginerd 0:b562096246b3 71 * \param pAddr1 First address.
enginerd 0:b562096246b3 72 * \param pAddr2 Second address.
enginerd 0:b562096246b3 73 *
enginerd 0:b562096246b3 74 * \return TRUE if addresses match, FALSE otherwise.
enginerd 0:b562096246b3 75 */
enginerd 0:b562096246b3 76 /*************************************************************************************************/
enginerd 0:b562096246b3 77 bool_t BdaCmp(uint8_t *pAddr1, uint8_t *pAddr2);
enginerd 0:b562096246b3 78
enginerd 0:b562096246b3 79 /*************************************************************************************************/
enginerd 0:b562096246b3 80 /*!
enginerd 0:b562096246b3 81 * \fn BdaClr
enginerd 0:b562096246b3 82 *
enginerd 0:b562096246b3 83 * \brief Set a BD address to all zeros.
enginerd 0:b562096246b3 84 *
enginerd 0:b562096246b3 85 * \param pDst Pointer to destination.
enginerd 0:b562096246b3 86 *
enginerd 0:b562096246b3 87 * \return pDst + BDA_ADDR_LEN
enginerd 0:b562096246b3 88 */
enginerd 0:b562096246b3 89 /*************************************************************************************************/
enginerd 0:b562096246b3 90 uint8_t *BdaClr(uint8_t *pDst);
enginerd 0:b562096246b3 91
enginerd 0:b562096246b3 92 /*************************************************************************************************/
enginerd 0:b562096246b3 93 /*!
enginerd 0:b562096246b3 94 * \fn Bda2Str
enginerd 0:b562096246b3 95 *
enginerd 0:b562096246b3 96 * \brief Convert a BD address to a string.
enginerd 0:b562096246b3 97 *
enginerd 0:b562096246b3 98 * \param pAddr Pointer to BD address.
enginerd 0:b562096246b3 99 *
enginerd 0:b562096246b3 100 * \return Pointer to string.
enginerd 0:b562096246b3 101 */
enginerd 0:b562096246b3 102 /*************************************************************************************************/
enginerd 0:b562096246b3 103 char *Bda2Str(uint8_t *pAddr);
enginerd 0:b562096246b3 104
enginerd 0:b562096246b3 105 #ifdef __cplusplus
enginerd 0:b562096246b3 106 };
enginerd 0:b562096246b3 107 #endif
enginerd 0:b562096246b3 108
enginerd 0:b562096246b3 109 #endif /* BDA_H */