Microbug / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Committer:
sam_grove
Date:
Thu Jan 09 16:41:15 2014 +0000
Revision:
28:f6022fb90701
Parent:
27:4a83843f04b0
Updated constructor to take parameters

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 27:4a83843f04b0 1 /* mbed Microcontroller Library
ktownsend 27:4a83843f04b0 2 * Copyright (c) 2006-2013 ARM Limited
ktownsend 27:4a83843f04b0 3 *
ktownsend 27:4a83843f04b0 4 * Licensed under the Apache License, Version 2.0 (the "License");
ktownsend 27:4a83843f04b0 5 * you may not use this file except in compliance with the License.
ktownsend 27:4a83843f04b0 6 * You may obtain a copy of the License at
ktownsend 27:4a83843f04b0 7 *
ktownsend 27:4a83843f04b0 8 * http://www.apache.org/licenses/LICENSE-2.0
ktownsend 27:4a83843f04b0 9 *
ktownsend 27:4a83843f04b0 10 * Unless required by applicable law or agreed to in writing, software
ktownsend 27:4a83843f04b0 11 * distributed under the License is distributed on an "AS IS" BASIS,
ktownsend 27:4a83843f04b0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ktownsend 27:4a83843f04b0 13 * See the License for the specific language governing permissions and
ktownsend 27:4a83843f04b0 14 * limitations under the License.
ktownsend 27:4a83843f04b0 15 */
ktownsend 27:4a83843f04b0 16
ktownsend 0:ace2e8d3ce79 17 #ifndef __NRF51822_H__
ktownsend 0:ace2e8d3ce79 18 #define __NRF51822_H__
ktownsend 0:ace2e8d3ce79 19
ktownsend 0:ace2e8d3ce79 20 #include "mbed.h"
ktownsend 0:ace2e8d3ce79 21 #include "blecommon.h"
ktownsend 27:4a83843f04b0 22 #include "BLERadio.h"
ktownsend 2:ffc5216bd2cc 23 #include "GattService.h"
ktownsend 0:ace2e8d3ce79 24
ktownsend 22:260313bcf4d0 25 /**************************************************************************/
ktownsend 22:260313bcf4d0 26 /*!
ktownsend 22:260313bcf4d0 27 \brief
ktownsend 22:260313bcf4d0 28 Driver for the nRF51822 in connectivity mode using custom serialization
ktownsend 22:260313bcf4d0 29 firmware.
ktownsend 22:260313bcf4d0 30 */
ktownsend 22:260313bcf4d0 31 /**************************************************************************/
ktownsend 0:ace2e8d3ce79 32 class nRF51822 : public BLERadio
ktownsend 0:ace2e8d3ce79 33 {
ktownsend 0:ace2e8d3ce79 34 public:
sam_grove 28:f6022fb90701 35 nRF51822(PinName tx, PinName rx, PinName rts, PinName cts);
ktownsend 0:ace2e8d3ce79 36 virtual ~nRF51822(void);
ktownsend 0:ace2e8d3ce79 37
ktownsend 9:124ae067ae27 38 /* Functions that mus be implemented from BLERadio */
ktownsend 7:5e1f0d7f7c7d 39 virtual ble_error_t setAdvertising(GapAdvertisingParams &, GapAdvertisingData &, GapAdvertisingData &);
ktownsend 2:ffc5216bd2cc 40 virtual ble_error_t addService(GattService &);
ktownsend 23:f19c60478e1b 41 virtual ble_error_t readCharacteristic(uint8_t, uint8_t[], uint16_t);
ktownsend 23:f19c60478e1b 42 virtual ble_error_t writeCharacteristic(uint8_t, uint8_t[], uint16_t);
ktownsend 0:ace2e8d3ce79 43 virtual ble_error_t start(void);
ktownsend 0:ace2e8d3ce79 44 virtual ble_error_t stop(void);
ktownsend 0:ace2e8d3ce79 45 virtual ble_error_t reset(void);
ktownsend 0:ace2e8d3ce79 46
ktownsend 2:ffc5216bd2cc 47 private:
ktownsend 17:9eb2b6fbbda9 48 RawSerial uart;
ktownsend 2:ffc5216bd2cc 49
ktownsend 0:ace2e8d3ce79 50 /* nRF51 Functions */
ktownsend 0:ace2e8d3ce79 51 void uartCallback(void);
ktownsend 0:ace2e8d3ce79 52 };
ktownsend 0:ace2e8d3ce79 53
ktownsend 0:ace2e8d3ce79 54 #endif