Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
Diff: services/UARTService.h
- Revision:
- 233:4d570d99b8cb
- Parent:
- 227:5c4cb4553821
- Child:
- 242:0e9201b67e2f
--- 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;