Bill Schilit / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Mon Dec 16 19:43:33 2013 +0000
Revision:
9:124ae067ae27
Parent:
7:5e1f0d7f7c7d
Child:
17:9eb2b6fbbda9
Preview code enabling most advertising features (requires new nRF51 firmware)

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 9:124ae067ae27 15 /* Functions that mus be implemented from BLERadio */
ktownsend 7:5e1f0d7f7c7d 16 virtual ble_error_t setAdvertising(GapAdvertisingParams &, GapAdvertisingData &, 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 private:
ktownsend 2:ffc5216bd2cc 25 Serial uart;
ktownsend 2:ffc5216bd2cc 26
ktownsend 0:ace2e8d3ce79 27 /* nRF51 Functions */
ktownsend 0:ace2e8d3ce79 28 void uartCallback(void);
ktownsend 0:ace2e8d3ce79 29 };
ktownsend 0:ace2e8d3ce79 30
ktownsend 0:ace2e8d3ce79 31 #endif