Junichi Katsu
/
BLE_MPU6050_test6_challenge_sb
テスト用です。
nRF51822_wallbot/nRF51Gap.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 | /* mbed Microcontroller Library |
jksoft | 0:8468a4403fea | 2 | * Copyright (c) 2006-2013 ARM Limited |
jksoft | 0:8468a4403fea | 3 | * |
jksoft | 0:8468a4403fea | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
jksoft | 0:8468a4403fea | 5 | * you may not use this file except in compliance with the License. |
jksoft | 0:8468a4403fea | 6 | * You may obtain a copy of the License at |
jksoft | 0:8468a4403fea | 7 | * |
jksoft | 0:8468a4403fea | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
jksoft | 0:8468a4403fea | 9 | * |
jksoft | 0:8468a4403fea | 10 | * Unless required by applicable law or agreed to in writing, software |
jksoft | 0:8468a4403fea | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
jksoft | 0:8468a4403fea | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
jksoft | 0:8468a4403fea | 13 | * See the License for the specific language governing permissions and |
jksoft | 0:8468a4403fea | 14 | * limitations under the License. |
jksoft | 0:8468a4403fea | 15 | */ |
jksoft | 0:8468a4403fea | 16 | |
jksoft | 0:8468a4403fea | 17 | #ifndef __NRF51822_GAP_H__ |
jksoft | 0:8468a4403fea | 18 | #define __NRF51822_GAP_H__ |
jksoft | 0:8468a4403fea | 19 | |
jksoft | 0:8468a4403fea | 20 | #include "mbed.h" |
jksoft | 0:8468a4403fea | 21 | #include "blecommon.h" |
jksoft | 0:8468a4403fea | 22 | #include "ble.h" |
jksoft | 0:8468a4403fea | 23 | #include "GapAdvertisingParams.h" |
jksoft | 0:8468a4403fea | 24 | #include "GapAdvertisingData.h" |
jksoft | 0:8468a4403fea | 25 | #include "public/Gap.h" |
jksoft | 0:8468a4403fea | 26 | |
jksoft | 0:8468a4403fea | 27 | /**************************************************************************/ |
jksoft | 0:8468a4403fea | 28 | /*! |
jksoft | 0:8468a4403fea | 29 | \brief |
jksoft | 0:8468a4403fea | 30 | |
jksoft | 0:8468a4403fea | 31 | */ |
jksoft | 0:8468a4403fea | 32 | /**************************************************************************/ |
jksoft | 0:8468a4403fea | 33 | class nRF51Gap : public Gap |
jksoft | 0:8468a4403fea | 34 | { |
jksoft | 0:8468a4403fea | 35 | public: |
jksoft | 0:8468a4403fea | 36 | static nRF51Gap &getInstance() { |
jksoft | 0:8468a4403fea | 37 | static nRF51Gap m_instance; |
jksoft | 0:8468a4403fea | 38 | return m_instance; |
jksoft | 0:8468a4403fea | 39 | } |
jksoft | 0:8468a4403fea | 40 | |
jksoft | 0:8468a4403fea | 41 | /* Functions that must be implemented from Gap */ |
jksoft | 0:8468a4403fea | 42 | virtual ble_error_t setAddress(addr_type_t type, const address_t address); |
jksoft | 0:8468a4403fea | 43 | virtual ble_error_t getAddress(addr_type_t *typeP, address_t address); |
jksoft | 0:8468a4403fea | 44 | virtual ble_error_t setAdvertisingData(const GapAdvertisingData &, const GapAdvertisingData &); |
jksoft | 0:8468a4403fea | 45 | virtual ble_error_t startAdvertising(const GapAdvertisingParams &); |
jksoft | 0:8468a4403fea | 46 | virtual ble_error_t stopAdvertising(void); |
jksoft | 0:8468a4403fea | 47 | virtual ble_error_t disconnect(DisconnectionReason_t reason); |
jksoft | 0:8468a4403fea | 48 | |
jksoft | 0:8468a4403fea | 49 | virtual ble_error_t setDeviceName(const uint8_t *deviceName); |
jksoft | 0:8468a4403fea | 50 | virtual ble_error_t getDeviceName(uint8_t *deviceName, unsigned *lengthP); |
jksoft | 0:8468a4403fea | 51 | virtual ble_error_t setAppearance(uint16_t appearance); |
jksoft | 0:8468a4403fea | 52 | virtual ble_error_t getAppearance(uint16_t *appearanceP); |
jksoft | 0:8468a4403fea | 53 | |
jksoft | 0:8468a4403fea | 54 | void setConnectionHandle(uint16_t con_handle); |
jksoft | 0:8468a4403fea | 55 | uint16_t getConnectionHandle(void); |
jksoft | 0:8468a4403fea | 56 | |
jksoft | 0:8468a4403fea | 57 | virtual ble_error_t getPreferredConnectionParams(ConnectionParams_t *params); |
jksoft | 0:8468a4403fea | 58 | virtual ble_error_t setPreferredConnectionParams(const ConnectionParams_t *params); |
jksoft | 0:8468a4403fea | 59 | virtual ble_error_t updateConnectionParams(Handle_t handle, const ConnectionParams_t *params); |
jksoft | 0:8468a4403fea | 60 | |
jksoft | 0:8468a4403fea | 61 | private: |
jksoft | 0:8468a4403fea | 62 | uint16_t m_connectionHandle; |
jksoft | 0:8468a4403fea | 63 | nRF51Gap() { |
jksoft | 0:8468a4403fea | 64 | m_connectionHandle = BLE_CONN_HANDLE_INVALID; |
jksoft | 0:8468a4403fea | 65 | } |
jksoft | 0:8468a4403fea | 66 | |
jksoft | 0:8468a4403fea | 67 | nRF51Gap(nRF51Gap const &); |
jksoft | 0:8468a4403fea | 68 | void operator=(nRF51Gap const &); |
jksoft | 0:8468a4403fea | 69 | }; |
jksoft | 0:8468a4403fea | 70 | |
jksoft | 0:8468a4403fea | 71 | #endif // ifndef __NRF51822_GAP_H__ |