BLE FOTA APP

Dependencies:   BLE_API mbed

It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.

Committer:
yihui
Date:
Fri Oct 10 03:36:28 2014 +0000
Revision:
1:a607cd9655d7
use NVIC_SystemReset() to run bootloader

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yihui 1:a607cd9655d7 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
yihui 1:a607cd9655d7 2 *
yihui 1:a607cd9655d7 3 * The information contained herein is property of Nordic Semiconductor ASA.
yihui 1:a607cd9655d7 4 * Terms and conditions of usage are described in detail in NORDIC
yihui 1:a607cd9655d7 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
yihui 1:a607cd9655d7 6 *
yihui 1:a607cd9655d7 7 * Licensees are granted free, non-transferable use of the information. NO
yihui 1:a607cd9655d7 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
yihui 1:a607cd9655d7 9 * the file.
yihui 1:a607cd9655d7 10 *
yihui 1:a607cd9655d7 11 */
yihui 1:a607cd9655d7 12
yihui 1:a607cd9655d7 13 /**@file
yihui 1:a607cd9655d7 14 *
yihui 1:a607cd9655d7 15 * @defgroup ant_stack_handler_types Types definitions for ANT support in SoftDevice handler.
yihui 1:a607cd9655d7 16 * @{
yihui 1:a607cd9655d7 17 * @ingroup softdevice_handler
yihui 1:a607cd9655d7 18 * @brief This file contains the declarations of types required for ANT stack support. These
yihui 1:a607cd9655d7 19 * types will be defined when the preprocessor define ANT_STACK_SUPPORT_REQD is defined.
yihui 1:a607cd9655d7 20 */
yihui 1:a607cd9655d7 21
yihui 1:a607cd9655d7 22 #ifndef ANT_STACK_HANDLER_TYPES_H__
yihui 1:a607cd9655d7 23 #define ANT_STACK_HANDLER_TYPES_H__
yihui 1:a607cd9655d7 24
yihui 1:a607cd9655d7 25 #ifdef ANT_STACK_SUPPORT_REQD
yihui 1:a607cd9655d7 26
yihui 1:a607cd9655d7 27 #include <stdlib.h>
yihui 1:a607cd9655d7 28
yihui 1:a607cd9655d7 29 #define ANT_STACK_EVT_MSG_BUF_SIZE 32 /**< Size of ANT event message buffer. This will be provided to the SoftDevice while fetching an event. */
yihui 1:a607cd9655d7 30 #define ANT_STACK_EVT_STRUCT_SIZE (sizeof(ant_evt_t)) /**< Size of the @ref ant_evt_t structure. This will be used by the @ref softdevice_handler.h to internal event buffer size needed. */
yihui 1:a607cd9655d7 31
yihui 1:a607cd9655d7 32 /**@brief ANT stack event type. */
yihui 1:a607cd9655d7 33 typedef struct
yihui 1:a607cd9655d7 34 {
yihui 1:a607cd9655d7 35 uint8_t channel; /**< Channel number. */
yihui 1:a607cd9655d7 36 uint8_t event; /**< Event code. */
yihui 1:a607cd9655d7 37 uint8_t evt_buffer[ANT_STACK_EVT_MSG_BUF_SIZE]; /**< Event message buffer. */
yihui 1:a607cd9655d7 38 } ant_evt_t;
yihui 1:a607cd9655d7 39
yihui 1:a607cd9655d7 40 /**@brief Application ANT stack event handler type. */
yihui 1:a607cd9655d7 41 typedef void (*ant_evt_handler_t) (ant_evt_t * p_ant_evt);
yihui 1:a607cd9655d7 42
yihui 1:a607cd9655d7 43 /**@brief Function for registering for ANT events.
yihui 1:a607cd9655d7 44 *
yihui 1:a607cd9655d7 45 * @details The application should use this function to register for receiving ANT events from
yihui 1:a607cd9655d7 46 * the SoftDevice. If the application does not call this function, then any ANT event
yihui 1:a607cd9655d7 47 * that may be generated by the SoftDevice will NOT be fetched. Once the application has
yihui 1:a607cd9655d7 48 * registered for the events, it is not possible to possible to cancel the registration.
yihui 1:a607cd9655d7 49 * However, it is possible to register a different function for handling the events at
yihui 1:a607cd9655d7 50 * any point of time.
yihui 1:a607cd9655d7 51 *
yihui 1:a607cd9655d7 52 * @param[in] ant_evt_handler Function to be called for each received ANT event.
yihui 1:a607cd9655d7 53 *
yihui 1:a607cd9655d7 54 * @retval NRF_SUCCESS Successful registration.
yihui 1:a607cd9655d7 55 * @retval NRF_ERROR_NULL Null pointer provided as input.
yihui 1:a607cd9655d7 56 */
yihui 1:a607cd9655d7 57 uint32_t softdevice_ant_evt_handler_set(ant_evt_handler_t ant_evt_handler);
yihui 1:a607cd9655d7 58
yihui 1:a607cd9655d7 59 #else
yihui 1:a607cd9655d7 60
yihui 1:a607cd9655d7 61 // The ANT Stack support is not required.
yihui 1:a607cd9655d7 62
yihui 1:a607cd9655d7 63 #define ANT_STACK_EVT_STRUCT_SIZE 0 /**< Since the ANT stack support is not required, this is equated to 0, so that the @ref softdevice_handler.h can compute the internal event buffer size without having to care for ANT events.*/
yihui 1:a607cd9655d7 64
yihui 1:a607cd9655d7 65 #endif // ANT_STACK_SUPPORT_REQD
yihui 1:a607cd9655d7 66
yihui 1:a607cd9655d7 67 #endif // ANT_STACK_HANDLER_TYPES_H__
yihui 1:a607cd9655d7 68
yihui 1:a607cd9655d7 69 /** @} */