![](/media/cache/profiles/5f14615696649541a025d3d0f8e0447f.jpg.50x50_q85.jpg)
テスト用です。
nRF51822_wallbot/nordic/nrf-sdk/ble/ble_services/ble_tps.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) 2012 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 ble_sdk_srv_tps TX Power Service |
jksoft | 0:8468a4403fea | 16 | * @{ |
jksoft | 0:8468a4403fea | 17 | * @ingroup ble_sdk_srv |
jksoft | 0:8468a4403fea | 18 | * @brief TX Power Service module. |
jksoft | 0:8468a4403fea | 19 | * |
jksoft | 0:8468a4403fea | 20 | * @details This module implements the TX Power Service with the TX Power Level characteristic. |
jksoft | 0:8468a4403fea | 21 | * During initialization it adds the TX Power Service and TX Power Level characteristic |
jksoft | 0:8468a4403fea | 22 | * with the specified initial value to the BLE stack database. |
jksoft | 0:8468a4403fea | 23 | * |
jksoft | 0:8468a4403fea | 24 | * It provides a function for letting the application update the TX Power Level |
jksoft | 0:8468a4403fea | 25 | * characteristic. |
jksoft | 0:8468a4403fea | 26 | * |
jksoft | 0:8468a4403fea | 27 | * @note Attention! |
jksoft | 0:8468a4403fea | 28 | * To maintain compliance with Nordic Semiconductor ASA Bluetooth profile |
jksoft | 0:8468a4403fea | 29 | * qualification listings, this section of source code must not be modified. |
jksoft | 0:8468a4403fea | 30 | */ |
jksoft | 0:8468a4403fea | 31 | |
jksoft | 0:8468a4403fea | 32 | #ifndef BLE_TPS_H__ |
jksoft | 0:8468a4403fea | 33 | #define BLE_TPS_H__ |
jksoft | 0:8468a4403fea | 34 | |
jksoft | 0:8468a4403fea | 35 | #include <stdint.h> |
jksoft | 0:8468a4403fea | 36 | #include "ble.h" |
jksoft | 0:8468a4403fea | 37 | #include "ble_srv_common.h" |
jksoft | 0:8468a4403fea | 38 | |
jksoft | 0:8468a4403fea | 39 | /**@brief TX Power Service init structure. This contains all options and data needed for |
jksoft | 0:8468a4403fea | 40 | * initialization of the service. */ |
jksoft | 0:8468a4403fea | 41 | typedef struct |
jksoft | 0:8468a4403fea | 42 | { |
jksoft | 0:8468a4403fea | 43 | int8_t initial_tx_power_level; /**< Initial value of the TX Power Level characteristic (in dBm). */ |
jksoft | 0:8468a4403fea | 44 | ble_srv_security_mode_t tps_attr_md; /**< Initial Security Setting for TX Power Service Characteristics. */ |
jksoft | 0:8468a4403fea | 45 | } ble_tps_init_t; |
jksoft | 0:8468a4403fea | 46 | |
jksoft | 0:8468a4403fea | 47 | /**@brief TX Power Service structure. This contains various status information for the service. */ |
jksoft | 0:8468a4403fea | 48 | typedef struct |
jksoft | 0:8468a4403fea | 49 | { |
jksoft | 0:8468a4403fea | 50 | uint16_t service_handle; /**< Handle of TX Power Service (as provided by the BLE stack). */ |
jksoft | 0:8468a4403fea | 51 | ble_gatts_char_handles_t tx_power_level_handles; /**< Handles related to the TX Power Level characteristic. */ |
jksoft | 0:8468a4403fea | 52 | } ble_tps_t; |
jksoft | 0:8468a4403fea | 53 | |
jksoft | 0:8468a4403fea | 54 | /**@brief Function for initializing the TX Power Service. |
jksoft | 0:8468a4403fea | 55 | * |
jksoft | 0:8468a4403fea | 56 | * @param[out] p_tps TX Power Service structure. This structure will have to be supplied by |
jksoft | 0:8468a4403fea | 57 | * the application. It will be initialized by this function, and will later |
jksoft | 0:8468a4403fea | 58 | * be used to identify this particular service instance. |
jksoft | 0:8468a4403fea | 59 | * @param[in] p_tps_init Information needed to initialize the service. |
jksoft | 0:8468a4403fea | 60 | * |
jksoft | 0:8468a4403fea | 61 | * @return NRF_SUCCESS on successful initialization of service, otherwise an error code. |
jksoft | 0:8468a4403fea | 62 | */ |
jksoft | 0:8468a4403fea | 63 | uint32_t ble_tps_init(ble_tps_t * p_hrs, const ble_tps_init_t * p_tps_init); |
jksoft | 0:8468a4403fea | 64 | |
jksoft | 0:8468a4403fea | 65 | /**@brief Function for setting the state of the Sensor Contact Detected bit. |
jksoft | 0:8468a4403fea | 66 | * |
jksoft | 0:8468a4403fea | 67 | * @param[in] p_tps TX Power Service structure. |
jksoft | 0:8468a4403fea | 68 | * @param[in] tx_power_level New TX Power Level (unit dBm, range -100 to 20). |
jksoft | 0:8468a4403fea | 69 | * |
jksoft | 0:8468a4403fea | 70 | * @return NRF_SUCCESS on success, otherwise an error code. |
jksoft | 0:8468a4403fea | 71 | */ |
jksoft | 0:8468a4403fea | 72 | uint32_t ble_tps_tx_power_level_set(ble_tps_t * p_tps, int8_t tx_power_level); |
jksoft | 0:8468a4403fea | 73 | |
jksoft | 0:8468a4403fea | 74 | #endif // BLE_TPS_H__ |
jksoft | 0:8468a4403fea | 75 | |
jksoft | 0:8468a4403fea | 76 | /** @} */ |