Bill Schilit / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Tue Dec 10 07:32:12 2013 +0000
Revision:
2:ffc5216bd2cc
Parent:
1:fd3ec64b2345
Child:
7:5e1f0d7f7c7d
UART Tests

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 0:ace2e8d3ce79 1 #ifndef __NRF51822_H__
ktownsend 0:ace2e8d3ce79 2 #define __NRF51822_H__
ktownsend 0:ace2e8d3ce79 3
ktownsend 0:ace2e8d3ce79 4 #include "mbed.h"
ktownsend 0:ace2e8d3ce79 5 #include "blecommon.h"
ktownsend 0:ace2e8d3ce79 6 #include "bleradio.h"
ktownsend 2:ffc5216bd2cc 7 #include "GattService.h"
ktownsend 0:ace2e8d3ce79 8
ktownsend 0:ace2e8d3ce79 9 class nRF51822 : public BLERadio
ktownsend 0:ace2e8d3ce79 10 {
ktownsend 0:ace2e8d3ce79 11 public:
ktownsend 0:ace2e8d3ce79 12 nRF51822();
ktownsend 0:ace2e8d3ce79 13 virtual ~nRF51822(void);
ktownsend 0:ace2e8d3ce79 14
ktownsend 0:ace2e8d3ce79 15 /* Functions that mus be implemented from NRFRadio */
ktownsend 2:ffc5216bd2cc 16 virtual ble_error_t setAdvertising(GapAdvertisingParams &, GapAdvertisingData &);
ktownsend 2:ffc5216bd2cc 17 virtual ble_error_t addService(GattService &);
ktownsend 2:ffc5216bd2cc 18 virtual ble_error_t readCharacteristic(GattService &, GattCharacteristic &, uint8_t[], uint16_t);
ktownsend 2:ffc5216bd2cc 19 virtual ble_error_t writeCharacteristic(GattService &, GattCharacteristic &, uint8_t[], uint16_t);
ktownsend 0:ace2e8d3ce79 20 virtual ble_error_t start(void);
ktownsend 0:ace2e8d3ce79 21 virtual ble_error_t stop(void);
ktownsend 0:ace2e8d3ce79 22 virtual ble_error_t reset(void);
ktownsend 0:ace2e8d3ce79 23
ktownsend 2:ffc5216bd2cc 24 void test(void);
ktownsend 2:ffc5216bd2cc 25
ktownsend 2:ffc5216bd2cc 26 private:
ktownsend 2:ffc5216bd2cc 27 Serial uart;
ktownsend 2:ffc5216bd2cc 28
ktownsend 0:ace2e8d3ce79 29 /* nRF51 Functions */
ktownsend 0:ace2e8d3ce79 30 void uartCallback(void);
ktownsend 0:ace2e8d3ce79 31 };
ktownsend 0:ace2e8d3ce79 32
ktownsend 0:ace2e8d3ce79 33 #endif