Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
dfu_app_handler.h
00001 /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. 00002 * 00003 * The information contained herein is property of Nordic Semiconductor ASA. 00004 * Terms and conditions of usage are described in detail in NORDIC 00005 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 00006 * 00007 * Licensees are granted free, non-transferable use of the information. NO 00008 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 00009 * the file. 00010 * 00011 */ 00012 00013 /** @file 00014 * 00015 * @defgroup nrf_dfu_app_handler DFU BLE packet handling in Application 00016 * @{ 00017 * 00018 * @brief DFU BLE packet handling for application. 00019 * 00020 * @details This module implements handling of DFU packets transmitted over BLE for switching from 00021 * application mode to Bootloader running full DFU service. 00022 * This module only handles the StartDFU packet allowing for any BLE application to expose 00023 * support for the DFU service. 00024 * Actual DFU service will execute in dedicated environment after a BLE disconnect and 00025 * reset of the nRF51 chip. 00026 * The host must then reconnect and can continue the update procedure with access to full 00027 * DFU service. 00028 * 00029 * @note The application must propagate dfu events to the DFU App handler module by calling 00030 * dfu_app_on_dfu_evt() from the from the @ref ble_dfu_evt_handler_t callback. 00031 */ 00032 00033 #ifndef DFU_APP_HANDLER_H__ 00034 #define DFU_APP_HANDLER_H__ 00035 00036 #include "dfu_app_handler.h " 00037 #include "ble_dfu.h " 00038 00039 /**@brief DFU Application reset prepare function. This function is a callback which allows the 00040 * application to prepare for an upcoming application reset. 00041 */ 00042 typedef void (*dfu_app_reset_prepare_t)(void); 00043 00044 00045 /**@brief Function for handling of \ref ble_dfu_evt_t from DFU Service. 00046 * 00047 * @details The application must inject this function into the DFU service or propagate DFU events 00048 * to dfu_app_handler module by calling this function in application specific DFU event 00049 * handler. 00050 * 00051 * @param[in] p_dfu Pointer to the DFU Service structure for which the include event relates. 00052 * @param[in] p_evt Pointer to the DFU event. 00053 */ 00054 void dfu_app_on_dfu_evt(ble_dfu_t * p_dfu, ble_dfu_evt_t * p_evt); 00055 00056 00057 /**@brief Function for registering for reset prepare calls. 00058 * 00059 * @details The function provided will be executed before reseting the system into Bootloader/DFU 00060 * mode. By setting this function the caller will be notified prior to the reset and can 00061 * thus prepare the application for reset. As example the application can gracefully 00062 * disconnect any peers on BLE, turning of LEDS, ensure all pending flash operations 00063 * has completed, etc. 00064 * 00065 * @param[in] reset_prepare_func Function to be execute prior to a reset. 00066 */ 00067 void dfu_app_reset_prepare_set(dfu_app_reset_prepare_t reset_prepare_func); 00068 00069 00070 #endif // DFU_APP_HANDLER_H__ 00071 00072 /** @} */
Generated on Tue Jul 12 2022 21:00:58 by
1.7.2