![](/media/cache/profiles/5f14615696649541a025d3d0f8e0447f.jpg.50x50_q85.jpg)
テスト用です。
nRF51822_wallbot/nordic/nrf-sdk/bootloader_dfu/dfu_app_handler.h@0:8468a4403fea, 2016-10-11 (annotated)
- Committer:
- jksoft
- Date:
- Tue Oct 11 11:09:42 2016 +0000
- Revision:
- 0:8468a4403fea
SB??ver;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:8468a4403fea | 1 | /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. |
jksoft | 0:8468a4403fea | 2 | * |
jksoft | 0:8468a4403fea | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
jksoft | 0:8468a4403fea | 4 | * Terms and conditions of usage are described in detail in NORDIC |
jksoft | 0:8468a4403fea | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 0:8468a4403fea | 6 | * |
jksoft | 0:8468a4403fea | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 0:8468a4403fea | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 0:8468a4403fea | 9 | * the file. |
jksoft | 0:8468a4403fea | 10 | * |
jksoft | 0:8468a4403fea | 11 | */ |
jksoft | 0:8468a4403fea | 12 | |
jksoft | 0:8468a4403fea | 13 | /** @file |
jksoft | 0:8468a4403fea | 14 | * |
jksoft | 0:8468a4403fea | 15 | * @defgroup nrf_dfu_app_handler DFU BLE packet handling in Application |
jksoft | 0:8468a4403fea | 16 | * @{ |
jksoft | 0:8468a4403fea | 17 | * |
jksoft | 0:8468a4403fea | 18 | * @brief DFU BLE packet handling for application. |
jksoft | 0:8468a4403fea | 19 | * |
jksoft | 0:8468a4403fea | 20 | * @details This module implements handling of DFU packets transmitted over BLE for switching from |
jksoft | 0:8468a4403fea | 21 | * application mode to Bootloader running full DFU service. |
jksoft | 0:8468a4403fea | 22 | * This module only handles the StartDFU packet allowing for any BLE application to expose |
jksoft | 0:8468a4403fea | 23 | * support for the DFU service. |
jksoft | 0:8468a4403fea | 24 | * Actual DFU service will execute in dedicated environment after a BLE disconnect and |
jksoft | 0:8468a4403fea | 25 | * reset of the nRF51 chip. |
jksoft | 0:8468a4403fea | 26 | * The host must then reconnect and can continue the update procedure with access to full |
jksoft | 0:8468a4403fea | 27 | * DFU service. |
jksoft | 0:8468a4403fea | 28 | * |
jksoft | 0:8468a4403fea | 29 | * @note The application must propagate dfu events to the DFU App handler module by calling |
jksoft | 0:8468a4403fea | 30 | * dfu_app_on_dfu_evt() from the from the @ref ble_dfu_evt_handler_t callback. |
jksoft | 0:8468a4403fea | 31 | */ |
jksoft | 0:8468a4403fea | 32 | |
jksoft | 0:8468a4403fea | 33 | #ifndef DFU_APP_HANDLER_H__ |
jksoft | 0:8468a4403fea | 34 | #define DFU_APP_HANDLER_H__ |
jksoft | 0:8468a4403fea | 35 | |
jksoft | 0:8468a4403fea | 36 | #include "dfu_app_handler.h" |
jksoft | 0:8468a4403fea | 37 | #include "ble_dfu.h" |
jksoft | 0:8468a4403fea | 38 | |
jksoft | 0:8468a4403fea | 39 | /**@brief DFU Application reset prepare function. This function is a callback which allows the |
jksoft | 0:8468a4403fea | 40 | * application to prepare for an upcoming application reset. |
jksoft | 0:8468a4403fea | 41 | */ |
jksoft | 0:8468a4403fea | 42 | typedef void (*dfu_app_reset_prepare_t)(void); |
jksoft | 0:8468a4403fea | 43 | |
jksoft | 0:8468a4403fea | 44 | |
jksoft | 0:8468a4403fea | 45 | /**@brief Function for handling of \ref ble_dfu_evt_t from DFU Service. |
jksoft | 0:8468a4403fea | 46 | * |
jksoft | 0:8468a4403fea | 47 | * @details The application must inject this function into the DFU service or propagate DFU events |
jksoft | 0:8468a4403fea | 48 | * to dfu_app_handler module by calling this function in application specific DFU event |
jksoft | 0:8468a4403fea | 49 | * handler. |
jksoft | 0:8468a4403fea | 50 | * |
jksoft | 0:8468a4403fea | 51 | * @param[in] p_dfu Pointer to the DFU Service structure for which the include event relates. |
jksoft | 0:8468a4403fea | 52 | * @param[in] p_evt Pointer to the DFU event. |
jksoft | 0:8468a4403fea | 53 | */ |
jksoft | 0:8468a4403fea | 54 | void dfu_app_on_dfu_evt(ble_dfu_t * p_dfu, ble_dfu_evt_t * p_evt); |
jksoft | 0:8468a4403fea | 55 | |
jksoft | 0:8468a4403fea | 56 | |
jksoft | 0:8468a4403fea | 57 | /**@brief Function for registering for reset prepare calls. |
jksoft | 0:8468a4403fea | 58 | * |
jksoft | 0:8468a4403fea | 59 | * @details The function provided will be executed before reseting the system into Bootloader/DFU |
jksoft | 0:8468a4403fea | 60 | * mode. By setting this function the caller will be notified prior to the reset and can |
jksoft | 0:8468a4403fea | 61 | * thus prepare the application for reset. As example the application can gracefully |
jksoft | 0:8468a4403fea | 62 | * disconnect any peers on BLE, turning of LEDS, ensure all pending flash operations |
jksoft | 0:8468a4403fea | 63 | * has completed, etc. |
jksoft | 0:8468a4403fea | 64 | * |
jksoft | 0:8468a4403fea | 65 | * @param[in] reset_prepare_func Function to be execute prior to a reset. |
jksoft | 0:8468a4403fea | 66 | */ |
jksoft | 0:8468a4403fea | 67 | void dfu_app_reset_prepare_set(dfu_app_reset_prepare_t reset_prepare_func); |
jksoft | 0:8468a4403fea | 68 | |
jksoft | 0:8468a4403fea | 69 | |
jksoft | 0:8468a4403fea | 70 | #endif // DFU_APP_HANDLER_H__ |
jksoft | 0:8468a4403fea | 71 | |
jksoft | 0:8468a4403fea | 72 | /** @} */ |