Cefn Hoile / nRF51822

Dependencies:   nrf51-sdk

Dependents:   microbit-dal

Fork of nRF51822 by Lancaster University

Committer:
rgrover1
Date:
Mon Jul 06 10:13:27 2015 +0100
Revision:
371:8f7d2137727a
Parent:
370:295f76db798e
Synchronized with git rev 2716309c
Author: Rohit Grover
Release 0.4.0
=============

This is a major release which introduces the GATT Client functionality. It
aligns with release 0.4.0 of BLE_API.

Enhancements
~~~~~~~~~~~~

* Introduce GattClient. This includes functionality for service-discovery,
connections, and attribute-reads and writes. You'll find a demo program for
LEDBlinker on the mbed.org Bluetooth team page to use the new APIs. Some of
the GATT client functionality hasn't been implemented yet, but the APIs have
been added.

* We've added an implementation for the abstract base class for
SecurityManager. All security related APIs have been moved into that.

* There has been a major cleanup of APIs under BLE. APIs have now been
categorized as belonging to Gap, GattServer, GattClient, or SecurityManager.
There are accessors to get references for Gap, GattServer, GattClient, and
SecurityManager. A former call to ble.setAddress(...) is now expected to be
achieved with ble.gap().setAddress(...).

* We've cleaned up our APIs, and this has resulted in dropping some APIs like
BLE::reset().

* We've also dropped GattServer::initializeGattDatabase(). THis was added at
some point to support controllers where a commit point was needed to
indicate when the application had finished constructing the GATT database.
This API would get called internally before Gap::startAdvertising(). We now
expect the underlying port to do the equivalent of initializeGattDatabase()
implicitly upon Gap::startAdvertising().

* We've added a version of Gap::disconnect() which takes a connection handle.
The previous API (which did not take a connection handle) has been
deprecated; it will still work for situations where there's only a single
active connection. We hold on to that API to allow existing code to migrate
to the new API.

Bugfixes
~~~~~~~~

* None.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 371:8f7d2137727a 1 /*
rgrover1 371:8f7d2137727a 2 * Copyright (c) Nordic Semiconductor ASA
rgrover1 371:8f7d2137727a 3 * All rights reserved.
rgrover1 371:8f7d2137727a 4 *
rgrover1 371:8f7d2137727a 5 * Redistribution and use in source and binary forms, with or without modification,
rgrover1 371:8f7d2137727a 6 * are permitted provided that the following conditions are met:
rgrover1 371:8f7d2137727a 7 *
rgrover1 371:8f7d2137727a 8 * 1. Redistributions of source code must retain the above copyright notice, this
rgrover1 371:8f7d2137727a 9 * list of conditions and the following disclaimer.
rgrover1 371:8f7d2137727a 10 *
rgrover1 371:8f7d2137727a 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this
rgrover1 371:8f7d2137727a 12 * list of conditions and the following disclaimer in the documentation and/or
rgrover1 371:8f7d2137727a 13 * other materials provided with the distribution.
rgrover1 371:8f7d2137727a 14 *
rgrover1 371:8f7d2137727a 15 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other
rgrover1 371:8f7d2137727a 16 * contributors to this software may be used to endorse or promote products
rgrover1 371:8f7d2137727a 17 * derived from this software without specific prior written permission.
rgrover1 371:8f7d2137727a 18 *
rgrover1 371:8f7d2137727a 19 *
rgrover1 371:8f7d2137727a 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
rgrover1 371:8f7d2137727a 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
rgrover1 371:8f7d2137727a 22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
rgrover1 371:8f7d2137727a 23 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
rgrover1 371:8f7d2137727a 24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
rgrover1 371:8f7d2137727a 25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
rgrover1 371:8f7d2137727a 26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
rgrover1 371:8f7d2137727a 27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
rgrover1 371:8f7d2137727a 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
rgrover1 371:8f7d2137727a 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
rgrover1 371:8f7d2137727a 30 *
rgrover1 371:8f7d2137727a 31 */
rgrover1 371:8f7d2137727a 32
rgrover1 371:8f7d2137727a 33 /** @file
rgrover1 371:8f7d2137727a 34 * @brief Utilities for verifying program logic
rgrover1 371:8f7d2137727a 35 */
rgrover1 371:8f7d2137727a 36
rgrover1 371:8f7d2137727a 37 #ifndef NRF_ASSERT_H_
rgrover1 371:8f7d2137727a 38 #define NRF_ASSERT_H_
rgrover1 371:8f7d2137727a 39
rgrover1 371:8f7d2137727a 40 #include <stdint.h>
rgrover1 371:8f7d2137727a 41 #include "compiler_abstraction.h"
rgrover1 371:8f7d2137727a 42 #ifdef __cplusplus
rgrover1 371:8f7d2137727a 43 extern "C" {
rgrover1 371:8f7d2137727a 44 #endif
rgrover1 371:8f7d2137727a 45
rgrover1 371:8f7d2137727a 46 #if defined(DEBUG_NRF) || defined(DEBUG_NRF_USER)
rgrover1 371:8f7d2137727a 47
rgrover1 371:8f7d2137727a 48 /** @brief Function for handling assertions.
rgrover1 371:8f7d2137727a 49 *
rgrover1 371:8f7d2137727a 50 *
rgrover1 371:8f7d2137727a 51 * @note
rgrover1 371:8f7d2137727a 52 * This function is called when an assertion has triggered.
rgrover1 371:8f7d2137727a 53 *
rgrover1 371:8f7d2137727a 54 *
rgrover1 371:8f7d2137727a 55 * @post
rgrover1 371:8f7d2137727a 56 * All hardware is put into an idle non-emitting state (in particular the radio is highly
rgrover1 371:8f7d2137727a 57 * important to switch off since the radio might be in a state that makes it send
rgrover1 371:8f7d2137727a 58 * packets continiously while a typical final infinit ASSERT loop is executing).
rgrover1 371:8f7d2137727a 59 *
rgrover1 371:8f7d2137727a 60 *
rgrover1 371:8f7d2137727a 61 * @param line_num The line number where the assertion is called
rgrover1 371:8f7d2137727a 62 * @param file_name Pointer to the file name
rgrover1 371:8f7d2137727a 63 */
rgrover1 371:8f7d2137727a 64 void assert_nrf_callback(uint16_t line_num, const uint8_t *file_name);
rgrover1 371:8f7d2137727a 65
rgrover1 371:8f7d2137727a 66 /*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */
rgrover1 371:8f7d2137727a 67 /*lint -emacro(774, ASSERT) */ /* Suppress "Boolean within 'if' always evaluates to True" */ \
rgrover1 371:8f7d2137727a 68
rgrover1 371:8f7d2137727a 69 /** @brief Function for checking intended for production code.
rgrover1 371:8f7d2137727a 70 *
rgrover1 371:8f7d2137727a 71 * Check passes if "expr" evaluates to true. */
rgrover1 371:8f7d2137727a 72 #define ASSERT(expr) \
rgrover1 371:8f7d2137727a 73 if (expr) \
rgrover1 371:8f7d2137727a 74 { \
rgrover1 371:8f7d2137727a 75 } \
rgrover1 371:8f7d2137727a 76 else \
rgrover1 371:8f7d2137727a 77 { \
rgrover1 371:8f7d2137727a 78 assert_nrf_callback((uint16_t)__LINE__, (uint8_t *)__FILE__); \
rgrover1 371:8f7d2137727a 79 }
rgrover1 371:8f7d2137727a 80 #else
rgrover1 371:8f7d2137727a 81 #define ASSERT(expr) //!< Assert empty when disabled
rgrover1 371:8f7d2137727a 82 __WEAK void assert_nrf_callback(uint16_t line_num, const uint8_t *file_name);
rgrover1 371:8f7d2137727a 83 #endif /* defined(DEBUG_NRF) || defined(DEBUG_NRF_USER) */
rgrover1 371:8f7d2137727a 84
rgrover1 371:8f7d2137727a 85 #ifdef __cplusplus
rgrover1 371:8f7d2137727a 86 }
rgrover1 371:8f7d2137727a 87 #endif
rgrover1 371:8f7d2137727a 88
rgrover1 371:8f7d2137727a 89 #endif /* NRF_ASSERT_H_ */