![](/media/cache/profiles/312e53ccba0b2ddfefd4a1f05b55bcdd.jpg.50x50_q85.jpg)
BLE FOTA APP
It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.
nRF51822/nordic/ble/ble_advdata_parser.cpp@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 | #include "ble_advdata_parser.h" |
yihui | 1:a607cd9655d7 | 2 | |
yihui | 1:a607cd9655d7 | 3 | uint32_t ble_advdata_parser_field_find(uint8_t type, uint8_t * p_advdata, uint8_t * len, uint8_t ** pp_field_data) |
yihui | 1:a607cd9655d7 | 4 | { |
yihui | 1:a607cd9655d7 | 5 | uint32_t index = 0; |
yihui | 1:a607cd9655d7 | 6 | |
yihui | 1:a607cd9655d7 | 7 | while (index < *len) |
yihui | 1:a607cd9655d7 | 8 | { |
yihui | 1:a607cd9655d7 | 9 | uint8_t field_length = p_advdata[index]; |
yihui | 1:a607cd9655d7 | 10 | uint8_t field_type = p_advdata[index+1]; |
yihui | 1:a607cd9655d7 | 11 | |
yihui | 1:a607cd9655d7 | 12 | if (field_type == type) |
yihui | 1:a607cd9655d7 | 13 | { |
yihui | 1:a607cd9655d7 | 14 | *pp_field_data = &p_advdata[index+2]; |
yihui | 1:a607cd9655d7 | 15 | *len = field_length-1; |
yihui | 1:a607cd9655d7 | 16 | return NRF_SUCCESS; |
yihui | 1:a607cd9655d7 | 17 | } |
yihui | 1:a607cd9655d7 | 18 | index += field_length+1; |
yihui | 1:a607cd9655d7 | 19 | } |
yihui | 1:a607cd9655d7 | 20 | return NRF_ERROR_NOT_FOUND; |
yihui | 1:a607cd9655d7 | 21 | } |