Initial commit
mbed-dev-master/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/cb_gatt_utils.h@0:bb348c97df44, 2020-09-16 (annotated)
- Committer:
- lypinator
- Date:
- Wed Sep 16 01:11:49 2020 +0000
- Revision:
- 0:bb348c97df44
Added PWM
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lypinator | 0:bb348c97df44 | 1 | /* |
lypinator | 0:bb348c97df44 | 2 | *--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 3 | * Copyright (c) 2016, u-blox Malmö, All Rights Reserved |
lypinator | 0:bb348c97df44 | 4 | * SPDX-License-Identifier: LicenseRef-PBL |
lypinator | 0:bb348c97df44 | 5 | * |
lypinator | 0:bb348c97df44 | 6 | * This file and the related binary are licensed under the |
lypinator | 0:bb348c97df44 | 7 | * Permissive Binary License, Version 1.0 (the "License"); |
lypinator | 0:bb348c97df44 | 8 | * you may not use these files except in compliance with the License. |
lypinator | 0:bb348c97df44 | 9 | * |
lypinator | 0:bb348c97df44 | 10 | * You may obtain a copy of the License here: |
lypinator | 0:bb348c97df44 | 11 | * LICENSE-permissive-binary-license-1.0.txt and at |
lypinator | 0:bb348c97df44 | 12 | * https://www.mbed.com/licenses/PBL-1.0 |
lypinator | 0:bb348c97df44 | 13 | * |
lypinator | 0:bb348c97df44 | 14 | * See the License for the specific language governing permissions and |
lypinator | 0:bb348c97df44 | 15 | * limitations under the License. |
lypinator | 0:bb348c97df44 | 16 | * |
lypinator | 0:bb348c97df44 | 17 | * Component : GATT |
lypinator | 0:bb348c97df44 | 18 | * File : cb_gatt_utils.h |
lypinator | 0:bb348c97df44 | 19 | * |
lypinator | 0:bb348c97df44 | 20 | * Description : Helper functions for GATT |
lypinator | 0:bb348c97df44 | 21 | * |
lypinator | 0:bb348c97df44 | 22 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 23 | |
lypinator | 0:bb348c97df44 | 24 | /** |
lypinator | 0:bb348c97df44 | 25 | * @file cb_gatt_utils.h |
lypinator | 0:bb348c97df44 | 26 | * |
lypinator | 0:bb348c97df44 | 27 | * @brief Helper functions for GATT |
lypinator | 0:bb348c97df44 | 28 | */ |
lypinator | 0:bb348c97df44 | 29 | |
lypinator | 0:bb348c97df44 | 30 | #ifndef _CB_GATT_UTILS_H_ |
lypinator | 0:bb348c97df44 | 31 | #define _CB_GATT_UTILS_H_ |
lypinator | 0:bb348c97df44 | 32 | |
lypinator | 0:bb348c97df44 | 33 | #include "cb_comdefs.h" |
lypinator | 0:bb348c97df44 | 34 | #include "bt_types.h" |
lypinator | 0:bb348c97df44 | 35 | #include "cb_gatt.h" |
lypinator | 0:bb348c97df44 | 36 | |
lypinator | 0:bb348c97df44 | 37 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 38 | extern "C" { |
lypinator | 0:bb348c97df44 | 39 | #endif |
lypinator | 0:bb348c97df44 | 40 | |
lypinator | 0:bb348c97df44 | 41 | /*============================================================================= |
lypinator | 0:bb348c97df44 | 42 | * FUNCTIONS |
lypinator | 0:bb348c97df44 | 43 | *============================================================================= |
lypinator | 0:bb348c97df44 | 44 | */ |
lypinator | 0:bb348c97df44 | 45 | |
lypinator | 0:bb348c97df44 | 46 | /** |
lypinator | 0:bb348c97df44 | 47 | * Returns a string representing the error code. NULL if the error code is |
lypinator | 0:bb348c97df44 | 48 | * not found. |
lypinator | 0:bb348c97df44 | 49 | * @param errorCode GATT error code |
lypinator | 0:bb348c97df44 | 50 | */ |
lypinator | 0:bb348c97df44 | 51 | cb_char* cbGATT_UTILS_getStringFromErrorCode( |
lypinator | 0:bb348c97df44 | 52 | cbGATT_ErrorCode errorCode); |
lypinator | 0:bb348c97df44 | 53 | |
lypinator | 0:bb348c97df44 | 54 | /** |
lypinator | 0:bb348c97df44 | 55 | * Returns a string representing the GATT/ATT properties for a characteristic. |
lypinator | 0:bb348c97df44 | 56 | * @param properties Bitmap of properties see cbGATT_PROP_* |
lypinator | 0:bb348c97df44 | 57 | */ |
lypinator | 0:bb348c97df44 | 58 | cb_char* cbGATT_UTILS_getStringFromProperties( |
lypinator | 0:bb348c97df44 | 59 | cb_uint8 properties); |
lypinator | 0:bb348c97df44 | 60 | |
lypinator | 0:bb348c97df44 | 61 | /** |
lypinator | 0:bb348c97df44 | 62 | * Returns a string representing the UUID. NULL if the UUID is not |
lypinator | 0:bb348c97df44 | 63 | * found. |
lypinator | 0:bb348c97df44 | 64 | * @param pUuid Pointer to 128 or 16-bit UUID |
lypinator | 0:bb348c97df44 | 65 | */ |
lypinator | 0:bb348c97df44 | 66 | cb_char* cbGATT_UTILS_getStringFromUuid( |
lypinator | 0:bb348c97df44 | 67 | cbGATT_Uuid* pUuid); |
lypinator | 0:bb348c97df44 | 68 | |
lypinator | 0:bb348c97df44 | 69 | /** |
lypinator | 0:bb348c97df44 | 70 | * Returns a string representing the UUID as hex bytes. |
lypinator | 0:bb348c97df44 | 71 | * @param pUuid Pointer to 128 or 16-bit UUID |
lypinator | 0:bb348c97df44 | 72 | * @param resultStr Allocated buffer to put hex string in. |
lypinator | 0:bb348c97df44 | 73 | * Should fit 16*2+1 = 33 bytes |
lypinator | 0:bb348c97df44 | 74 | */ |
lypinator | 0:bb348c97df44 | 75 | cb_char* cbGATT_UTILS_getHexStringFromUuid( |
lypinator | 0:bb348c97df44 | 76 | cbGATT_Uuid* pUuid, |
lypinator | 0:bb348c97df44 | 77 | cb_char* resultStr); |
lypinator | 0:bb348c97df44 | 78 | |
lypinator | 0:bb348c97df44 | 79 | /** |
lypinator | 0:bb348c97df44 | 80 | * Returns a string representing the data as hex bytes. |
lypinator | 0:bb348c97df44 | 81 | * @param pData Pointer to data |
lypinator | 0:bb348c97df44 | 82 | * @param len Length of data |
lypinator | 0:bb348c97df44 | 83 | * @param resultStr Pointer to allocated buffer to put hex string in. |
lypinator | 0:bb348c97df44 | 84 | * Should fit len*2+1 bytes |
lypinator | 0:bb348c97df44 | 85 | */ |
lypinator | 0:bb348c97df44 | 86 | cb_char* cbGATT_UTILS_dataToHex( |
lypinator | 0:bb348c97df44 | 87 | cb_uint8* pData, |
lypinator | 0:bb348c97df44 | 88 | cb_uint16 len, |
lypinator | 0:bb348c97df44 | 89 | cb_char* resultStr); |
lypinator | 0:bb348c97df44 | 90 | |
lypinator | 0:bb348c97df44 | 91 | /** |
lypinator | 0:bb348c97df44 | 92 | * Reverse bytes |
lypinator | 0:bb348c97df44 | 93 | * @param src Pointer to data to reverse bytes for |
lypinator | 0:bb348c97df44 | 94 | * @param nbrOfBytes Length of src |
lypinator | 0:bb348c97df44 | 95 | */ |
lypinator | 0:bb348c97df44 | 96 | void cbGATT_UTILS_reverseBytes( |
lypinator | 0:bb348c97df44 | 97 | cb_uint8* src, |
lypinator | 0:bb348c97df44 | 98 | cb_uint16 nbrOfBytes); |
lypinator | 0:bb348c97df44 | 99 | |
lypinator | 0:bb348c97df44 | 100 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 101 | } |
lypinator | 0:bb348c97df44 | 102 | #endif |
lypinator | 0:bb348c97df44 | 103 | |
lypinator | 0:bb348c97df44 | 104 | #endif |