Workings and tests to create custom GATT services, for use as part of peripheral communication in cars
Dependencies: BLE_API mbed nRF51822
Diff: BroadcasterService.h
- Revision:
- 7:5c983cf3c352
- Parent:
- 4:ac0ee88ea0ed
- Child:
- 8:3376f79e7d50
--- a/BroadcasterService.h Tue Feb 24 14:53:04 2015 +0000 +++ b/BroadcasterService.h Tue Feb 24 14:55:44 2015 +0000 @@ -1,28 +1,27 @@ -#ifndef __BLE_TEST_SERVICE_H__ -#define __BLE_TEST_SERVICE_H__ +#ifndef __BLE_BROADCASTER_SERVICE_H__ +#define __BLE_BROADCASTER_SERVICE_H__ #include "BLEDevice.h" /** -* @class BatteryService -* @brief BLE Battery Service. This service displays the battery level from 0%->100% represented as a 8bit number.<br> -* Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.battery_service.xml <br> -* Battery Level Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.battery_level.xml +* @class BroadcasterService +* @brief Based heavily on the BLE Battery Service, the aim is to send key, pair values <br> */ -class BroadcasterService { +class BroadcasterService +{ public: /** * @param[ref] _ble - * - * @param[in] + * + * @param[in] */ BroadcasterService(BLEDevice &_ble, uint8_t _command) : ble(_ble), command(_command), broadcasterCharacteristic(0x2A67, &command, sizeof(command), sizeof(command), - GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | - // GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | - GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) { + GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | + // GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | + GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) { static bool serviceAdded = false; /* We should only ever need to add the service once. */ if (serviceAdded) { @@ -37,9 +36,9 @@ } /** - * @brief + * @brief * - * @param + * @param */ void sendCommand(uint8_t _newCommand) { command = _newCommand; @@ -52,4 +51,4 @@ GattCharacteristic broadcasterCharacteristic; }; -#endif /* #ifndef __BLE_TEST_SERVICE_H__*/ \ No newline at end of file +#endif \ No newline at end of file