テスト用
Fork of nRF51822 by
Diff: nRF51Gap.h
- Revision:
- 17:c3e11bb6cb72
- Parent:
- 3:791d672cbbec
- Child:
- 22:c6ee8136847e
--- a/nRF51Gap.h Fri May 30 13:32:48 2014 +0100 +++ b/nRF51Gap.h Wed Jun 04 09:19:57 2014 +0100 @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + #ifndef __NRF51822_GAP_H__ #define __NRF51822_GAP_H__ @@ -32,30 +32,33 @@ /**************************************************************************/ class nRF51Gap : public Gap { - public: - static nRF51Gap& getInstance() - { - static nRF51Gap m_instance; - return m_instance; - } +public: + static nRF51Gap& getInstance() + { + static nRF51Gap m_instance; + return m_instance; + } - /* Functions that must be implemented from Gap */ - virtual ble_error_t setAddress(addr_type_t type, - const uint8_t address[6]); - virtual ble_error_t setAdvertisingData(const GapAdvertisingData &, - const GapAdvertisingData &); - virtual ble_error_t startAdvertising(const GapAdvertisingParams &); - virtual ble_error_t stopAdvertising(void); - virtual ble_error_t disconnect(void); - - void setConnectionHandle(uint16_t con_handle); - uint16_t getConnectionHandle(void); - - private: - uint16_t m_connectionHandle; - nRF51Gap() { m_connectionHandle = BLE_CONN_HANDLE_INVALID; }; - nRF51Gap(nRF51Gap const&); - void operator=(nRF51Gap const&); + /* Functions that must be implemented from Gap */ + virtual ble_error_t setAddress(addr_type_t type, + const uint8_t address[6]); + virtual ble_error_t setAdvertisingData(const GapAdvertisingData &, + const GapAdvertisingData &); + virtual ble_error_t startAdvertising(const GapAdvertisingParams &); + virtual ble_error_t stopAdvertising(void); + virtual ble_error_t disconnect(void); + + void setConnectionHandle(uint16_t con_handle); + uint16_t getConnectionHandle(void); + +private: + uint16_t m_connectionHandle; + nRF51Gap() { + m_connectionHandle = BLE_CONN_HANDLE_INVALID; + } + + nRF51Gap(nRF51Gap const&); + void operator=(nRF51Gap const&); }; -#endif +#endif // ifndef __NRF51822_GAP_H__