Bill Schilit / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Fri Nov 29 14:42:22 2013 +0000
Revision:
0:ace2e8d3ce79
Child:
1:fd3ec64b2345
First commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 0:ace2e8d3ce79 1 #ifndef __BLE_RADIO_H__
ktownsend 0:ace2e8d3ce79 2 #define __BLE_RADIO_H__
ktownsend 0:ace2e8d3ce79 3
ktownsend 0:ace2e8d3ce79 4 #include "blecommon.h"
ktownsend 0:ace2e8d3ce79 5 #include "bleservice.h"
ktownsend 0:ace2e8d3ce79 6
ktownsend 0:ace2e8d3ce79 7 class BLERadio
ktownsend 0:ace2e8d3ce79 8 {
ktownsend 0:ace2e8d3ce79 9 public:
ktownsend 0:ace2e8d3ce79 10 typedef enum radio_event_e
ktownsend 0:ace2e8d3ce79 11 {
ktownsend 0:ace2e8d3ce79 12 RADIO_EVENT_CONNECT = 0x01,
ktownsend 0:ace2e8d3ce79 13 RADIO_EVENT_DISCONNECT = 0x02,
ktownsend 0:ace2e8d3ce79 14 RADIO_EVENT_WRITE = 0x03,
ktownsend 0:ace2e8d3ce79 15 RADIO_EVENT_RADIOERROR = 0x80
ktownsend 0:ace2e8d3ce79 16 } radioEvent_t;
ktownsend 0:ace2e8d3ce79 17
ktownsend 0:ace2e8d3ce79 18 uint8_t serviceCount;
ktownsend 0:ace2e8d3ce79 19
ktownsend 0:ace2e8d3ce79 20 /* ToDo: Force constructor with event handler callback */
ktownsend 0:ace2e8d3ce79 21
ktownsend 0:ace2e8d3ce79 22 /* These functions must be defined in the sub-class */
ktownsend 0:ace2e8d3ce79 23 virtual ble_error_t attach(void (*fptr)(void));
ktownsend 0:ace2e8d3ce79 24 virtual ble_error_t addService(BLEService &) = 0;
ktownsend 0:ace2e8d3ce79 25 virtual ble_error_t updateValue(uint8_t, uint8_t, uint8_t[], uint16_t) = 0;
ktownsend 0:ace2e8d3ce79 26 virtual ble_error_t start(void) = 0;
ktownsend 0:ace2e8d3ce79 27 virtual ble_error_t stop(void) = 0;
ktownsend 0:ace2e8d3ce79 28 virtual ble_error_t reset(void) = 0;
ktownsend 0:ace2e8d3ce79 29 };
ktownsend 0:ace2e8d3ce79 30
ktownsend 0:ace2e8d3ce79 31 #endif