Caching the advertising data and the scan response.
Fork of MaximBLE by
exactLE/hci/maxwsn/hci_drv.h@1:4e764337d5c5, 2016-03-22 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
enginerd | 0:b562096246b3 | 1 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 2 | /*! |
enginerd | 0:b562096246b3 | 3 | * \file hci_drv.h |
enginerd | 0:b562096246b3 | 4 | * |
enginerd | 0:b562096246b3 | 5 | * \brief HCI driver interface. |
enginerd | 0:b562096246b3 | 6 | * |
enginerd | 0:b562096246b3 | 7 | * $Date: 2013-01-02 22:19:17 -0800 (Wed, 02 Jan 2013) $ |
enginerd | 0:b562096246b3 | 8 | * $Revision: 405 $ |
enginerd | 0:b562096246b3 | 9 | * |
enginerd | 0:b562096246b3 | 10 | * Copyright (c) 2012-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 HCI_DRV_H |
enginerd | 0:b562096246b3 | 23 | #define HCI_DRV_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 | #include "PinNames.h" |
enginerd | 0:b562096246b3 | 30 | |
enginerd | 0:b562096246b3 | 31 | /************************************************************************************************** |
enginerd | 0:b562096246b3 | 32 | Function Declarations |
enginerd | 0:b562096246b3 | 33 | **************************************************************************************************/ |
enginerd | 0:b562096246b3 | 34 | |
enginerd | 0:b562096246b3 | 35 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 36 | /*! |
enginerd | 0:b562096246b3 | 37 | * \fn hciDrvInit |
enginerd | 0:b562096246b3 | 38 | * |
enginerd | 0:b562096246b3 | 39 | * \brief Initialize the driver. |
enginerd | 0:b562096246b3 | 40 | * |
enginerd | 0:b562096246b3 | 41 | * \param csn name of the pin connected to CSN |
enginerd | 0:b562096246b3 | 42 | * \param irq name of the pin conntected to IRQ |
enginerd | 0:b562096246b3 | 43 | */ |
enginerd | 0:b562096246b3 | 44 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 45 | void hciDrvInit(PinName csn, PinName rst, PinName irq); |
enginerd | 0:b562096246b3 | 46 | |
enginerd | 0:b562096246b3 | 47 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 48 | /*! |
enginerd | 0:b562096246b3 | 49 | * \fn hciDrvWrite |
enginerd | 0:b562096246b3 | 50 | * |
enginerd | 0:b562096246b3 | 51 | * \brief Write data to the driver. |
enginerd | 0:b562096246b3 | 52 | * |
enginerd | 0:b562096246b3 | 53 | * \param type HCI packet type |
enginerd | 0:b562096246b3 | 54 | * \param len Number of bytes to write. |
enginerd | 0:b562096246b3 | 55 | * \param pData Byte array to write. |
enginerd | 0:b562096246b3 | 56 | * |
enginerd | 0:b562096246b3 | 57 | * \return Return actual number of data bytes written. |
enginerd | 0:b562096246b3 | 58 | * |
enginerd | 0:b562096246b3 | 59 | * \note The type parameter allows the driver layer to prepend the data with a header on the |
enginerd | 0:b562096246b3 | 60 | * same write transaction. |
enginerd | 0:b562096246b3 | 61 | */ |
enginerd | 0:b562096246b3 | 62 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 63 | uint16_t hciDrvWrite(uint8_t type, uint16_t len, uint8_t *pData); |
enginerd | 0:b562096246b3 | 64 | |
enginerd | 0:b562096246b3 | 65 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 66 | /*! |
enginerd | 0:b562096246b3 | 67 | * \fn hciDrvRead |
enginerd | 0:b562096246b3 | 68 | * |
enginerd | 0:b562096246b3 | 69 | * \brief Read data bytes from the driver. |
enginerd | 0:b562096246b3 | 70 | * |
enginerd | 0:b562096246b3 | 71 | * \param len Number of bytes to read. |
enginerd | 0:b562096246b3 | 72 | * \param pData Byte array to store data. |
enginerd | 0:b562096246b3 | 73 | * |
enginerd | 0:b562096246b3 | 74 | * \return Return actual number of data bytes read. |
enginerd | 0:b562096246b3 | 75 | */ |
enginerd | 0:b562096246b3 | 76 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 77 | uint16_t hciDrvRead(uint16_t len, uint8_t *pData, bool_t last); |
enginerd | 0:b562096246b3 | 78 | |
enginerd | 0:b562096246b3 | 79 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 80 | /*! |
enginerd | 0:b562096246b3 | 81 | * \fn hciDrvIsr |
enginerd | 0:b562096246b3 | 82 | * |
enginerd | 0:b562096246b3 | 83 | * \brief Interrupt service routine for IRQ |
enginerd | 0:b562096246b3 | 84 | */ |
enginerd | 0:b562096246b3 | 85 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 86 | void hciDrvIsr(void); |
enginerd | 0:b562096246b3 | 87 | |
enginerd | 0:b562096246b3 | 88 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 89 | /*! |
enginerd | 0:b562096246b3 | 90 | * \fn hciDrvReadyToSleep |
enginerd | 0:b562096246b3 | 91 | * |
enginerd | 0:b562096246b3 | 92 | * \brief Returns TRUE if driver allows MCU to enter low power sleep mode. |
enginerd | 0:b562096246b3 | 93 | * |
enginerd | 0:b562096246b3 | 94 | * \return TRUE if ready to sleep, FALSE otherwise. |
enginerd | 0:b562096246b3 | 95 | */ |
enginerd | 0:b562096246b3 | 96 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 97 | bool_t hciDrvReadyToSleep(void); |
enginerd | 0:b562096246b3 | 98 | |
enginerd | 0:b562096246b3 | 99 | void hciDrvResume(void); |
enginerd | 0:b562096246b3 | 100 | |
enginerd | 0:b562096246b3 | 101 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 102 | /*! |
enginerd | 0:b562096246b3 | 103 | * \fn hciDrvReset |
enginerd | 0:b562096246b3 | 104 | * |
enginerd | 0:b562096246b3 | 105 | * \brief Resets the controller |
enginerd | 0:b562096246b3 | 106 | */ |
enginerd | 0:b562096246b3 | 107 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 108 | void hciDrvReset(void); |
enginerd | 0:b562096246b3 | 109 | |
enginerd | 0:b562096246b3 | 110 | #ifdef __cplusplus |
enginerd | 0:b562096246b3 | 111 | }; |
enginerd | 0:b562096246b3 | 112 | #endif |
enginerd | 0:b562096246b3 | 113 | |
enginerd | 0:b562096246b3 | 114 | #endif /* HCI_DRV_H */ |