Refactoring and other updates
Dependencies: BLE_API mbed nRF51822
Fork of nRF51822_SimpleChat by
Diff: BTDevice.hpp
- Revision:
- 5:fca87573ed92
- Parent:
- 3:b6e4e5529a52
--- a/BTDevice.hpp Mon May 08 13:17:49 2017 +0000 +++ b/BTDevice.hpp Mon May 08 21:57:59 2017 +0000 @@ -16,21 +16,6 @@ static const uint8_t uart_rx_uuid[] = {0x71, 0x3D, 0, 2, 0x50, 0x3E, 0x4C, 0x75, 0xBA, 0x94, 0x31, 0x48, 0xF1, 0x8D, 0x94, 0x1E}; static const uint8_t uart_base_uuid_rev[] = {0x1E, 0x94, 0x8D, 0xF1, 0x48, 0x31, 0x94, 0xBA, 0x75, 0x4C, 0x3E, 0x50, 0, 0, 0x3D, 0x71}; - -// The Nordic UART Service -//static const uint8_t uart_base_uuid[] = {0x71, 0x3D, 0, 0, 0x50, 0x3E, 0x4C, 0x75, 0xBA, 0x94, 0x31, 0x48, 0xF1, 0x8D, 0x94, 0x1E}; -//static const uint8_t uart_tx_uuid[] = {0x71, 0x3D, 0, 3, 0x50, 0x3E, 0x4C, 0x75, 0xBA, 0x94, 0x31, 0x48, 0xF1, 0x8D, 0x94, 0x1E}; -//static const uint8_t uart_rx_uuid[] = {0x71, 0x3D, 0, 2, 0x50, 0x3E, 0x4C, 0x75, 0xBA, 0x94, 0x31, 0x48, 0xF1, 0x8D, 0x94, 0x1E}; -//static const uint8_t uart_base_uuid_rev[] = {0x1E, 0x94, 0x8D, 0xF1, 0x48, 0x31, 0x94, 0xBA, 0x75, 0x4C, 0x3E, 0x50, 0, 0, 0x3D, 0x71}; - -//static Serial pc(USBTX, USBRX); - -//static GattCharacteristic txCharacteristic (uart_tx_uuid, txPayload, 1, TXRX_BUF_LEN, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE); -//static GattCharacteristic rxCharacteristic (uart_rx_uuid, rxPayload, 1, TXRX_BUF_LEN, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY); -//static GattCharacteristic *uartChars[] = {&txCharacteristic, &rxCharacteristic}; -//static GattService uartService(uart_base_uuid, uartChars, sizeof(uartChars) / sizeof(GattCharacteristic *)); - - class BTDevice { public: @@ -73,7 +58,7 @@ void initCallback(BLE::InitializationCompleteCallbackContext *); // void connectionCallback(const BLE::ConnectionCompleteCallbackContext *params) {} //TODO if needed - // void disconnectionCallback(const BLE::DisconnectionCompleteCallbackContext *params); //TODO if needed + void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *); //TODO if needed void dataWriteCallback(const GattWriteCallbackParams *); void uartCallback(void);