To get started with Seeed Tiny BLE, include detecting motion, button and battery level.
Dependencies: BLE_API eMPL_MPU6050 mbed nRF51822
nRF51822/btle/custom/custom_helper.h@2:b61ddbb8528e, 2015-11-05 (annotated)
- Committer:
- yihui
- Date:
- Thu Nov 05 02:46:37 2015 +0000
- Revision:
- 2:b61ddbb8528e
- Parent:
- 1:fc2f9d636751
able to recover from i2c bus fault
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 1:fc2f9d636751 | 1 | /* mbed Microcontroller Library |
yihui | 1:fc2f9d636751 | 2 | * Copyright (c) 2006-2013 ARM Limited |
yihui | 1:fc2f9d636751 | 3 | * |
yihui | 1:fc2f9d636751 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
yihui | 1:fc2f9d636751 | 5 | * you may not use this file except in compliance with the License. |
yihui | 1:fc2f9d636751 | 6 | * You may obtain a copy of the License at |
yihui | 1:fc2f9d636751 | 7 | * |
yihui | 1:fc2f9d636751 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
yihui | 1:fc2f9d636751 | 9 | * |
yihui | 1:fc2f9d636751 | 10 | * Unless required by applicable law or agreed to in writing, software |
yihui | 1:fc2f9d636751 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
yihui | 1:fc2f9d636751 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
yihui | 1:fc2f9d636751 | 13 | * See the License for the specific language governing permissions and |
yihui | 1:fc2f9d636751 | 14 | * limitations under the License. |
yihui | 1:fc2f9d636751 | 15 | */ |
yihui | 1:fc2f9d636751 | 16 | |
yihui | 1:fc2f9d636751 | 17 | #ifndef _CUSTOM_HELPER_H_ |
yihui | 1:fc2f9d636751 | 18 | #define _CUSTOM_HELPER_H_ |
yihui | 1:fc2f9d636751 | 19 | |
yihui | 1:fc2f9d636751 | 20 | #ifdef __cplusplus |
yihui | 1:fc2f9d636751 | 21 | extern "C" { |
yihui | 1:fc2f9d636751 | 22 | #endif |
yihui | 1:fc2f9d636751 | 23 | |
yihui | 1:fc2f9d636751 | 24 | #include "common/common.h" |
yihui | 1:fc2f9d636751 | 25 | #include "ble.h" |
yihui | 1:fc2f9d636751 | 26 | #include "UUID.h" |
yihui | 1:fc2f9d636751 | 27 | |
yihui | 1:fc2f9d636751 | 28 | uint8_t custom_add_uuid_base(uint8_t const *const p_uuid_base); |
yihui | 1:fc2f9d636751 | 29 | error_t custom_decode_uuid(uint8_t const *const p_uuid_base, |
yihui | 1:fc2f9d636751 | 30 | ble_uuid_t *p_uuid); |
yihui | 1:fc2f9d636751 | 31 | ble_uuid_t custom_convert_to_nordic_uuid(const UUID &uuid); |
yihui | 1:fc2f9d636751 | 32 | |
yihui | 1:fc2f9d636751 | 33 | error_t custom_add_in_characteristic(uint16_t service_handle, |
yihui | 1:fc2f9d636751 | 34 | ble_uuid_t *p_uuid, |
yihui | 1:fc2f9d636751 | 35 | uint8_t properties, |
yihui | 1:fc2f9d636751 | 36 | uint8_t *p_data, |
yihui | 1:fc2f9d636751 | 37 | uint16_t min_length, |
yihui | 1:fc2f9d636751 | 38 | uint16_t max_length, |
yihui | 1:fc2f9d636751 | 39 | bool readAuthorization, |
yihui | 1:fc2f9d636751 | 40 | bool writeAuthorization, |
yihui | 1:fc2f9d636751 | 41 | ble_gatts_char_handles_t *p_char_handle); |
yihui | 1:fc2f9d636751 | 42 | |
yihui | 1:fc2f9d636751 | 43 | error_t custom_add_in_descriptor(uint16_t char_handle, |
yihui | 1:fc2f9d636751 | 44 | ble_uuid_t *p_uuid, |
yihui | 1:fc2f9d636751 | 45 | uint8_t *p_data, |
yihui | 1:fc2f9d636751 | 46 | uint16_t min_length, |
yihui | 1:fc2f9d636751 | 47 | uint16_t max_length, |
yihui | 1:fc2f9d636751 | 48 | uint16_t *p_desc_handle); |
yihui | 1:fc2f9d636751 | 49 | |
yihui | 1:fc2f9d636751 | 50 | #ifdef __cplusplus |
yihui | 1:fc2f9d636751 | 51 | } |
yihui | 1:fc2f9d636751 | 52 | #endif |
yihui | 1:fc2f9d636751 | 53 | |
yihui | 1:fc2f9d636751 | 54 | #endif // ifndef _CUSTOM_HELPER_H_ |