Initial commit
mbed-dev-master/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/cb_bt_pan.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 : Bluetooth PAN Data Manager |
lypinator | 0:bb348c97df44 | 18 | * File : cb_bt_pan.h |
lypinator | 0:bb348c97df44 | 19 | * |
lypinator | 0:bb348c97df44 | 20 | * Description : Data management for PAN profile |
lypinator | 0:bb348c97df44 | 21 | * |
lypinator | 0:bb348c97df44 | 22 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 23 | |
lypinator | 0:bb348c97df44 | 24 | #ifndef _CB_BT_PAN_H_ |
lypinator | 0:bb348c97df44 | 25 | #define _CB_BT_PAN_H_ |
lypinator | 0:bb348c97df44 | 26 | |
lypinator | 0:bb348c97df44 | 27 | #include "cb_comdefs.h" |
lypinator | 0:bb348c97df44 | 28 | #include "bt_types.h" |
lypinator | 0:bb348c97df44 | 29 | #include "cb_bt_conn_man.h" |
lypinator | 0:bb348c97df44 | 30 | |
lypinator | 0:bb348c97df44 | 31 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 32 | extern "C" { |
lypinator | 0:bb348c97df44 | 33 | #endif |
lypinator | 0:bb348c97df44 | 34 | |
lypinator | 0:bb348c97df44 | 35 | /*=========================================================================== |
lypinator | 0:bb348c97df44 | 36 | * DEFINES |
lypinator | 0:bb348c97df44 | 37 | *=========================================================================*/ |
lypinator | 0:bb348c97df44 | 38 | #define cbBTPAN_RESULT_OK ((cb_int32)0x00000000) |
lypinator | 0:bb348c97df44 | 39 | #define cbBTPAN_RESULT_ERROR ((cb_int32)0x00000001) |
lypinator | 0:bb348c97df44 | 40 | #define cbBTPAN_RESULT_ILLEGAL_HANDLE ((cb_int32)0x00000002) |
lypinator | 0:bb348c97df44 | 41 | #define cbBTPAN_RESULT_FLOW_STOP ((cb_int32)0x00000003) |
lypinator | 0:bb348c97df44 | 42 | #define cbBTPAN_RESULT_LINK_LOSS ((cb_int32)0x00000004) |
lypinator | 0:bb348c97df44 | 43 | |
lypinator | 0:bb348c97df44 | 44 | /*=========================================================================== |
lypinator | 0:bb348c97df44 | 45 | * TYPES |
lypinator | 0:bb348c97df44 | 46 | *=========================================================================*/ |
lypinator | 0:bb348c97df44 | 47 | typedef cb_uint32 cbBTPAN_Handle; |
lypinator | 0:bb348c97df44 | 48 | |
lypinator | 0:bb348c97df44 | 49 | /*--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 50 | * Callback to indicate that a Bnep connection has been established. |
lypinator | 0:bb348c97df44 | 51 | * |
lypinator | 0:bb348c97df44 | 52 | * @param connHandle: Connection handle |
lypinator | 0:bb348c97df44 | 53 | * @param info: Information about the connection |
lypinator | 0:bb348c97df44 | 54 | * |
lypinator | 0:bb348c97df44 | 55 | * @return None |
lypinator | 0:bb348c97df44 | 56 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 57 | typedef void(*cbBTPAN_ConnectEvt) (cbBCM_Handle connHandle, cbBCM_ConnectionInfo info); |
lypinator | 0:bb348c97df44 | 58 | |
lypinator | 0:bb348c97df44 | 59 | /*--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 60 | * Callback to indicate that a Bnep connection has been disconnected. |
lypinator | 0:bb348c97df44 | 61 | * |
lypinator | 0:bb348c97df44 | 62 | * @param connHandle: Connection handle |
lypinator | 0:bb348c97df44 | 63 | * |
lypinator | 0:bb348c97df44 | 64 | * @return None |
lypinator | 0:bb348c97df44 | 65 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 66 | typedef void(*cbBTPAN_DisconnectEvt) (cbBCM_Handle connHandle); |
lypinator | 0:bb348c97df44 | 67 | |
lypinator | 0:bb348c97df44 | 68 | /*--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 69 | * Callback to indicate that data has been received from remote device. |
lypinator | 0:bb348c97df44 | 70 | * |
lypinator | 0:bb348c97df44 | 71 | * @param btPanHandle: PAN handle |
lypinator | 0:bb348c97df44 | 72 | * @param length: Length of the data |
lypinator | 0:bb348c97df44 | 73 | * @param pData: Pointer to the data |
lypinator | 0:bb348c97df44 | 74 | * |
lypinator | 0:bb348c97df44 | 75 | * @return None |
lypinator | 0:bb348c97df44 | 76 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 77 | typedef void(*cbBTPAN_DataEvt) (cbBCM_Handle connHandle, cb_uint8 * pData, cb_uint16 length); |
lypinator | 0:bb348c97df44 | 78 | |
lypinator | 0:bb348c97df44 | 79 | /*--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 80 | * Callback to indicate that data has been taken care by PAN. New |
lypinator | 0:bb348c97df44 | 81 | * data can now be sent on this handle. |
lypinator | 0:bb348c97df44 | 82 | * |
lypinator | 0:bb348c97df44 | 83 | * @param btPanHandle: PAN handle |
lypinator | 0:bb348c97df44 | 84 | * @param result: cbBTPAN_RESULT_OK if the data sending succeeded |
lypinator | 0:bb348c97df44 | 85 | * |
lypinator | 0:bb348c97df44 | 86 | * @return None |
lypinator | 0:bb348c97df44 | 87 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 88 | typedef void(*cbBTPAN_DataCnf) (cbBCM_Handle connHandle, cb_int32 result); |
lypinator | 0:bb348c97df44 | 89 | |
lypinator | 0:bb348c97df44 | 90 | typedef struct |
lypinator | 0:bb348c97df44 | 91 | { |
lypinator | 0:bb348c97df44 | 92 | cbBTPAN_ConnectEvt pfConnectEvt; |
lypinator | 0:bb348c97df44 | 93 | cbBTPAN_DisconnectEvt pfDisconnectEvt; |
lypinator | 0:bb348c97df44 | 94 | cbBTPAN_DataEvt pfDataEvt; |
lypinator | 0:bb348c97df44 | 95 | cbBTPAN_DataCnf pfWriteCnf; |
lypinator | 0:bb348c97df44 | 96 | } cbBTPAN_Callback; |
lypinator | 0:bb348c97df44 | 97 | |
lypinator | 0:bb348c97df44 | 98 | /*=========================================================================== |
lypinator | 0:bb348c97df44 | 99 | * FUNCTIONS |
lypinator | 0:bb348c97df44 | 100 | *=========================================================================*/ |
lypinator | 0:bb348c97df44 | 101 | /** |
lypinator | 0:bb348c97df44 | 102 | * Initialization of Bluetooth PAN data. Called during stack |
lypinator | 0:bb348c97df44 | 103 | * initialization. Shall not be called by application. |
lypinator | 0:bb348c97df44 | 104 | * |
lypinator | 0:bb348c97df44 | 105 | * @return None |
lypinator | 0:bb348c97df44 | 106 | */ |
lypinator | 0:bb348c97df44 | 107 | extern void cbBTPAN_init(void); |
lypinator | 0:bb348c97df44 | 108 | |
lypinator | 0:bb348c97df44 | 109 | /** |
lypinator | 0:bb348c97df44 | 110 | * Registers for PAN data callbacks. Only one registration is supported. |
lypinator | 0:bb348c97df44 | 111 | * |
lypinator | 0:bb348c97df44 | 112 | * @param pDataCallback Data callback |
lypinator | 0:bb348c97df44 | 113 | * |
lypinator | 0:bb348c97df44 | 114 | * @return cbBTPAN_RESULT_OK if successful |
lypinator | 0:bb348c97df44 | 115 | */ |
lypinator | 0:bb348c97df44 | 116 | extern cb_uint32 cbBTPAN_registerDataCallback(cbBTPAN_Callback * pDataCallback); |
lypinator | 0:bb348c97df44 | 117 | |
lypinator | 0:bb348c97df44 | 118 | /*--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 119 | * Sends data to the remote device. Note that you have to wait for the |
lypinator | 0:bb348c97df44 | 120 | * confirmation callback (cbBTPAN_DataCnf) before calling another cbBTPAN_reqData. |
lypinator | 0:bb348c97df44 | 121 | * |
lypinator | 0:bb348c97df44 | 122 | * @param connHandle: Connection handle |
lypinator | 0:bb348c97df44 | 123 | * @param pBuf: Pointer to the data |
lypinator | 0:bb348c97df44 | 124 | * @param bufSize: Length of the data |
lypinator | 0:bb348c97df44 | 125 | * |
lypinator | 0:bb348c97df44 | 126 | * @return cbBTPAN_RESULT_OK if successful |
lypinator | 0:bb348c97df44 | 127 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 128 | extern cb_int32 cbBTPAN_reqData(cbBCM_Handle connHandle, cb_uint8 * pBuf, cb_uint16 bufSize); |
lypinator | 0:bb348c97df44 | 129 | |
lypinator | 0:bb348c97df44 | 130 | /*--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 131 | * Gets the max frame size that can be sent/received with |
lypinator | 0:bb348c97df44 | 132 | * cbBTPAN_reqData/pfDataEvt |
lypinator | 0:bb348c97df44 | 133 | * |
lypinator | 0:bb348c97df44 | 134 | * @return max frame size |
lypinator | 0:bb348c97df44 | 135 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 136 | extern cb_int32 cbBTPAN_getMaxFrameSize(void); |
lypinator | 0:bb348c97df44 | 137 | |
lypinator | 0:bb348c97df44 | 138 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 139 | } |
lypinator | 0:bb348c97df44 | 140 | #endif |
lypinator | 0:bb348c97df44 | 141 | |
lypinator | 0:bb348c97df44 | 142 | #endif //_cb_BT_PAN_H_ |