BLE FOTA APP
It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.
nRF51822/nordic/nrf-sdk/ble/ble_services/ble_gls_db.h@1:a607cd9655d7, 2014-10-10 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 1:a607cd9655d7 | 1 | /* Copyright (c) 2012 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 | /** @file |
yihui | 1:a607cd9655d7 | 13 | * |
yihui | 1:a607cd9655d7 | 14 | * @defgroup ble_sdk_srv_gls_db Glucose Database Service |
yihui | 1:a607cd9655d7 | 15 | * @{ |
yihui | 1:a607cd9655d7 | 16 | * @ingroup ble_sdk_srv |
yihui | 1:a607cd9655d7 | 17 | * @brief Glucose Service module. |
yihui | 1:a607cd9655d7 | 18 | * |
yihui | 1:a607cd9655d7 | 19 | * @details This module implements at database of stored glucose measurement values. |
yihui | 1:a607cd9655d7 | 20 | * |
yihui | 1:a607cd9655d7 | 21 | * @note Attention! |
yihui | 1:a607cd9655d7 | 22 | * To maintain compliance with Nordic Semiconductor ASA Bluetooth profile |
yihui | 1:a607cd9655d7 | 23 | * qualification listings, These APIs must not be modified. However, the corresponding |
yihui | 1:a607cd9655d7 | 24 | * functions' implementations can be modified. |
yihui | 1:a607cd9655d7 | 25 | */ |
yihui | 1:a607cd9655d7 | 26 | |
yihui | 1:a607cd9655d7 | 27 | #ifndef BLE_GLS_DB_H__ |
yihui | 1:a607cd9655d7 | 28 | #define BLE_GLS_DB_H__ |
yihui | 1:a607cd9655d7 | 29 | |
yihui | 1:a607cd9655d7 | 30 | #include <stdint.h> |
yihui | 1:a607cd9655d7 | 31 | #include "ble_gls.h" |
yihui | 1:a607cd9655d7 | 32 | |
yihui | 1:a607cd9655d7 | 33 | #define BLE_GLS_DB_MAX_RECORDS 20 |
yihui | 1:a607cd9655d7 | 34 | |
yihui | 1:a607cd9655d7 | 35 | /**@brief Function for initializing the glucose record database. |
yihui | 1:a607cd9655d7 | 36 | * |
yihui | 1:a607cd9655d7 | 37 | * @details This call initializes the database holding glucose records. |
yihui | 1:a607cd9655d7 | 38 | * |
yihui | 1:a607cd9655d7 | 39 | * @return NRF_SUCCESS on success. |
yihui | 1:a607cd9655d7 | 40 | */ |
yihui | 1:a607cd9655d7 | 41 | uint32_t ble_gls_db_init(void); |
yihui | 1:a607cd9655d7 | 42 | |
yihui | 1:a607cd9655d7 | 43 | /**@brief Function for getting the number of records in the database. |
yihui | 1:a607cd9655d7 | 44 | * |
yihui | 1:a607cd9655d7 | 45 | * @details This call returns the number of records in the database. |
yihui | 1:a607cd9655d7 | 46 | * |
yihui | 1:a607cd9655d7 | 47 | * @return Number of records in the database. |
yihui | 1:a607cd9655d7 | 48 | */ |
yihui | 1:a607cd9655d7 | 49 | uint16_t ble_gls_db_num_records_get(void); |
yihui | 1:a607cd9655d7 | 50 | |
yihui | 1:a607cd9655d7 | 51 | /**@brief Function for getting a record from the database. |
yihui | 1:a607cd9655d7 | 52 | * |
yihui | 1:a607cd9655d7 | 53 | * @details This call returns a specified record from the database. |
yihui | 1:a607cd9655d7 | 54 | * |
yihui | 1:a607cd9655d7 | 55 | * @param[in] record_num Index of the record to retrieve. |
yihui | 1:a607cd9655d7 | 56 | * @param[out] p_rec Pointer to record structure where retrieved record is copied to. |
yihui | 1:a607cd9655d7 | 57 | * |
yihui | 1:a607cd9655d7 | 58 | * @return NRF_SUCCESS on success. |
yihui | 1:a607cd9655d7 | 59 | */ |
yihui | 1:a607cd9655d7 | 60 | uint32_t ble_gls_db_record_get(uint8_t record_num, ble_gls_rec_t * p_rec); |
yihui | 1:a607cd9655d7 | 61 | |
yihui | 1:a607cd9655d7 | 62 | /**@brief Function for adding a record at the end of the database. |
yihui | 1:a607cd9655d7 | 63 | * |
yihui | 1:a607cd9655d7 | 64 | * @details This call adds a record as the last record in the database. |
yihui | 1:a607cd9655d7 | 65 | * |
yihui | 1:a607cd9655d7 | 66 | * @param[in] p_rec Pointer to record to add to database. |
yihui | 1:a607cd9655d7 | 67 | * |
yihui | 1:a607cd9655d7 | 68 | * @return NRF_SUCCESS on success. |
yihui | 1:a607cd9655d7 | 69 | */ |
yihui | 1:a607cd9655d7 | 70 | uint32_t ble_gls_db_record_add(ble_gls_rec_t * p_rec); |
yihui | 1:a607cd9655d7 | 71 | |
yihui | 1:a607cd9655d7 | 72 | /**@brief Function for deleting a database entry. |
yihui | 1:a607cd9655d7 | 73 | * |
yihui | 1:a607cd9655d7 | 74 | * @details This call deletes an record from the database. |
yihui | 1:a607cd9655d7 | 75 | * |
yihui | 1:a607cd9655d7 | 76 | * @param[in] record_num Index of record to delete. |
yihui | 1:a607cd9655d7 | 77 | * |
yihui | 1:a607cd9655d7 | 78 | * @return NRF_SUCCESS on success. |
yihui | 1:a607cd9655d7 | 79 | */ |
yihui | 1:a607cd9655d7 | 80 | uint32_t ble_gls_db_record_delete(uint8_t record_num); |
yihui | 1:a607cd9655d7 | 81 | |
yihui | 1:a607cd9655d7 | 82 | #endif // BLE_GLS_DB_H__ |
yihui | 1:a607cd9655d7 | 83 | |
yihui | 1:a607cd9655d7 | 84 | /** @} */ |
yihui | 1:a607cd9655d7 | 85 | |
yihui | 1:a607cd9655d7 | 86 | /** @endcond */ |