iOSのBLEコントローラアプリ「RCBController」と接続し、コントローラの操作を取得するサンプルプログラムです。 mbed HRM1017で動作を確認しています。 2014.08.20時点でのBLEライブラリに対応しました。

Dependencies:   BLE_API mbed

Fork of BLE_RCBController by Junichi Katsu

Committer:
jksoft
Date:
Wed Aug 20 13:41:01 2014 +0000
Revision:
4:ebda47d22091
Parent:
nRF51822/nordic/nrf-sdk/ble/ble_error_log.h@1:48f6e08a3ac2
?????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 1:48f6e08a3ac2 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
jksoft 1:48f6e08a3ac2 2 *
jksoft 1:48f6e08a3ac2 3 * The information contained herein is property of Nordic Semiconductor ASA.
jksoft 1:48f6e08a3ac2 4 * Terms and conditions of usage are described in detail in NORDIC
jksoft 1:48f6e08a3ac2 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
jksoft 1:48f6e08a3ac2 6 *
jksoft 1:48f6e08a3ac2 7 * Licensees are granted free, non-transferable use of the information. NO
jksoft 1:48f6e08a3ac2 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
jksoft 1:48f6e08a3ac2 9 * the file.
jksoft 1:48f6e08a3ac2 10 *
jksoft 1:48f6e08a3ac2 11 */
jksoft 1:48f6e08a3ac2 12
jksoft 1:48f6e08a3ac2 13 /** @file
jksoft 1:48f6e08a3ac2 14 *
jksoft 1:48f6e08a3ac2 15 * @defgroup ble_error_log_module Error Log Module
jksoft 1:48f6e08a3ac2 16 * @{
jksoft 1:48f6e08a3ac2 17 * @ingroup ble_sdk_lib
jksoft 1:48f6e08a3ac2 18 * @brief Module for writing error and stack to flash memory.
jksoft 1:48f6e08a3ac2 19 *
jksoft 1:48f6e08a3ac2 20 * @details It contains functions for writing an error code, line number, filename/message and
jksoft 1:48f6e08a3ac2 21 * the stack to the flash during an error, e.g. in the assert handler.
jksoft 1:48f6e08a3ac2 22 *
jksoft 1:48f6e08a3ac2 23 */
jksoft 1:48f6e08a3ac2 24 #ifndef BLE_ERROR_LOG_H__
jksoft 1:48f6e08a3ac2 25 #define BLE_ERROR_LOG_H__
jksoft 1:48f6e08a3ac2 26
jksoft 1:48f6e08a3ac2 27 #include <stdint.h>
jksoft 1:48f6e08a3ac2 28 #include <stdbool.h>
jksoft 1:48f6e08a3ac2 29 #include "ble_flash.h"
jksoft 1:48f6e08a3ac2 30
jksoft 1:48f6e08a3ac2 31 #define ERROR_MESSAGE_LENGTH 128 /**< Length of error message to stored. */
jksoft 1:48f6e08a3ac2 32 #define STACK_DUMP_LENGTH 256 /**< Length of stack to be stored at max: 64 entries of 4 bytes each. */
jksoft 1:48f6e08a3ac2 33 #define FLASH_PAGE_ERROR_LOG (BLE_FLASH_PAGE_END - 2) /**< Address in flash where stack trace can be stored. */
jksoft 1:48f6e08a3ac2 34
jksoft 1:48f6e08a3ac2 35 /**@brief Error Log Data structure.
jksoft 1:48f6e08a3ac2 36 *
jksoft 1:48f6e08a3ac2 37 * @details The structure contains the error, message/filename, line number as well as the current
jksoft 1:48f6e08a3ac2 38 * stack, at the time where an error occured.
jksoft 1:48f6e08a3ac2 39 */
jksoft 1:48f6e08a3ac2 40 typedef struct
jksoft 1:48f6e08a3ac2 41 {
jksoft 1:48f6e08a3ac2 42 uint16_t failure; /**< Indication that a major failure has occurred during last execution of the application. */
jksoft 1:48f6e08a3ac2 43 uint16_t line_number; /**< Line number indicating at which line the failure occurred. */
jksoft 1:48f6e08a3ac2 44 uint32_t err_code; /**< Error code when failure occurred. */
jksoft 1:48f6e08a3ac2 45 uint8_t message[ERROR_MESSAGE_LENGTH]; /**< Will just use the first 128 bytes of filename to store for debugging purposes. */
jksoft 1:48f6e08a3ac2 46 uint32_t stack_info[STACK_DUMP_LENGTH / 4]; /**< Will contain stack information, can be manually unwinded for debug purposes. */
jksoft 1:48f6e08a3ac2 47 } ble_error_log_data_t;
jksoft 1:48f6e08a3ac2 48
jksoft 1:48f6e08a3ac2 49
jksoft 1:48f6e08a3ac2 50 /**@brief Function for writing the file name/message, line number, and current program stack
jksoft 1:48f6e08a3ac2 51 * to flash.
jksoft 1:48f6e08a3ac2 52 *
jksoft 1:48f6e08a3ac2 53 * @note This function will force the writing to flash, and disregard any radio communication.
jksoft 1:48f6e08a3ac2 54 * USE THIS FUNCTION WITH CARE.
jksoft 1:48f6e08a3ac2 55 *
jksoft 1:48f6e08a3ac2 56 * @param[in] err_code Error code to be logged.
jksoft 1:48f6e08a3ac2 57 * @param[in] p_message Message to be written to the flash together with stack dump, usually
jksoft 1:48f6e08a3ac2 58 * the file name where the error occured.
jksoft 1:48f6e08a3ac2 59 * @param[in] line_number Line number where the error occured.
jksoft 1:48f6e08a3ac2 60 *
jksoft 1:48f6e08a3ac2 61 * @return NRF_SUCCESS on successful writing of the error log.
jksoft 1:48f6e08a3ac2 62 *
jksoft 1:48f6e08a3ac2 63 */
jksoft 1:48f6e08a3ac2 64 uint32_t ble_error_log_write(uint32_t err_code, const uint8_t * p_message, uint16_t line_number);
jksoft 1:48f6e08a3ac2 65
jksoft 1:48f6e08a3ac2 66
jksoft 1:48f6e08a3ac2 67 #endif /* BLE_ERROR_LOG_H__ */
jksoft 1:48f6e08a3ac2 68
jksoft 1:48f6e08a3ac2 69 /** @} */