Bizan Nishimura / BLE_API

Dependents:   MiniSteer_BLE

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Thu Jan 16 22:29:53 2014 +0000
Revision:
29:011e95ce78b8
Added better radio abstraction layer, moved Gatt enums from blecommon.h to GattCharacteristic.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 29:011e95ce78b8 1 /* mbed Microcontroller Library
ktownsend 29:011e95ce78b8 2 * Copyright (c) 2006-2013 ARM Limited
ktownsend 29:011e95ce78b8 3 *
ktownsend 29:011e95ce78b8 4 * Licensed under the Apache License, Version 2.0 (the "License");
ktownsend 29:011e95ce78b8 5 * you may not use this file except in compliance with the License.
ktownsend 29:011e95ce78b8 6 * You may obtain a copy of the License at
ktownsend 29:011e95ce78b8 7 *
ktownsend 29:011e95ce78b8 8 * http://www.apache.org/licenses/LICENSE-2.0
ktownsend 29:011e95ce78b8 9 *
ktownsend 29:011e95ce78b8 10 * Unless required by applicable law or agreed to in writing, software
ktownsend 29:011e95ce78b8 11 * distributed under the License is distributed on an "AS IS" BASIS,
ktownsend 29:011e95ce78b8 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ktownsend 29:011e95ce78b8 13 * See the License for the specific language governing permissions and
ktownsend 29:011e95ce78b8 14 * limitations under the License.
ktownsend 29:011e95ce78b8 15 */
ktownsend 29:011e95ce78b8 16
ktownsend 29:011e95ce78b8 17 #ifndef __NRF51822_H__
ktownsend 29:011e95ce78b8 18 #define __NRF51822_H__
ktownsend 29:011e95ce78b8 19
ktownsend 29:011e95ce78b8 20 #include "mbed.h"
ktownsend 29:011e95ce78b8 21 #include "blecommon.h"
ktownsend 29:011e95ce78b8 22 #include "hw/BLEDevice.h"
ktownsend 29:011e95ce78b8 23 #include "hw/nRF51822s/nRF51Gap.h"
ktownsend 29:011e95ce78b8 24 #include "hw/nRF51822s/nRF51GattServer.h"
ktownsend 29:011e95ce78b8 25
ktownsend 29:011e95ce78b8 26 /**************************************************************************/
ktownsend 29:011e95ce78b8 27 /*!
ktownsend 29:011e95ce78b8 28 \brief
ktownsend 29:011e95ce78b8 29
ktownsend 29:011e95ce78b8 30 */
ktownsend 29:011e95ce78b8 31 /**************************************************************************/
ktownsend 29:011e95ce78b8 32 class nRF51822s : public BLEDevice
ktownsend 29:011e95ce78b8 33 {
ktownsend 29:011e95ce78b8 34 protected:
ktownsend 29:011e95ce78b8 35 RawSerial uart;
ktownsend 29:011e95ce78b8 36 nRF51Gap gap;
ktownsend 29:011e95ce78b8 37 nRF51GattServer gattServer;
ktownsend 29:011e95ce78b8 38
ktownsend 29:011e95ce78b8 39 public:
ktownsend 29:011e95ce78b8 40 nRF51822s(PinName, PinName, PinName, PinName);
ktownsend 29:011e95ce78b8 41 virtual ~nRF51822s(void);
ktownsend 29:011e95ce78b8 42
ktownsend 29:011e95ce78b8 43 virtual Gap& getGap() { return gap; };
ktownsend 29:011e95ce78b8 44 virtual GattServer& getGattServer() { return gattServer; };
ktownsend 29:011e95ce78b8 45 virtual ble_error_t reset(void);
ktownsend 29:011e95ce78b8 46
ktownsend 29:011e95ce78b8 47 private:
ktownsend 29:011e95ce78b8 48 void uartCallback(void);
ktownsend 29:011e95ce78b8 49 };
ktownsend 29:011e95ce78b8 50
ktownsend 29:011e95ce78b8 51 #endif