Lightly modified version of the BLE stack, that doesn't bring up a DFUService by default... as we have our own.
Fork of BLE_API by
Diff: services/UARTService.h
- Revision:
- 233:4d570d99b8cb
- Parent:
- 227:5c4cb4553821
- Child:
- 242:0e9201b67e2f
diff -r 4cfb5b8a4fb9 -r 4d570d99b8cb services/UARTService.h --- a/services/UARTService.h Mon Dec 08 17:47:58 2014 +0000 +++ b/services/UARTService.h Mon Dec 08 19:24:29 2014 +0000 @@ -34,6 +34,10 @@ extern const uint8_t UARTServiceTXCharacteristicUUID[LENGTH_OF_LONG_UUID]; extern const uint8_t UARTServiceRXCharacteristicUUID[LENGTH_OF_LONG_UUID]; +/** +* @class UARTService +* @breif BLE Service to enable UART over BLE +*/ class UARTService { public: /**< Maximum length of data (in bytes) that can be transmitted by the UART service module to the peer. */ @@ -41,6 +45,11 @@ static const unsigned BLE_UART_SERVICE_MAX_DATA_LEN = (GATT_MTU_SIZE_DEFAULT - 3); public: + + /** + * @param[ref] ble + * BLEDevice object for the underlying controller. + */ UARTService(BLEDevice &_ble) : ble(_ble), receiveBuffer(), @@ -131,6 +140,11 @@ return (write(&c, 1) == 1) ? 1 : EOF; } + /** + * Override for Stream::_getc() + * @return + * The character read. + */ int _getc() { if (receiveBufferIndex == numBytesReceived) { return EOF;