This is a basic program that provides the necessary BLE service to allow communications with the UPAS
Dependencies: BLE_API mbed nRF51822 CronoDot EEPROM NCP5623BMUTBG ADS1115 BME280 Calibration_one MCP40D17 SDFileSystem LSM303 SI1145 STC3100
Fork of BLE_Button by
Diff: UPAS_Service.h
- Revision:
- 15:c9c93454dd56
- Parent:
- 14:4fc1788b8ad2
- Child:
- 16:e066ab7e8fb3
--- a/UPAS_Service.h Tue Nov 03 01:34:58 2015 +0000 +++ b/UPAS_Service.h Tue Nov 03 01:41:53 2015 +0000 @@ -19,7 +19,7 @@ GattCharacteristic subjectLabelCharacteristic; const static uint16_t TWENTYFOURHOUR_CHARACTERISTIC_UUID = 0xA005; //UUID of variable that app will read from - GattCharacteristic twentyFourHourCharacteristic; + GattCharacteristic runReadyCharacteristic; const static uint16_t DEMO_CHARACTERISTIC_UUID = 0xA006; //UUID of variable that app will read from GattCharacteristic runModeCharacteristic; @@ -30,12 +30,12 @@ rtcCharacteristic(RTC_CHARACTERISTIC_UUID, rtc,6,20, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY ), sampleTimeCharacteristic(SAMPLETIME_CHARACTERISTIC_UUID, sampleTime,12,20,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY), subjectLabelCharacteristic(SUBJECTLABEL_CHARACTERISTIC_UUID, subjectLabel,15,20,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY), - twentyFourHourCharacteristic(TWENTYFOURHOUR_CHARACTERISTIC_UUID,0,0,20,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY), + runReadyCharacteristic(TWENTYFOURHOUR_CHARACTERISTIC_UUID,0,0,20,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY), runModeCharacteristic(DEMO_CHARACTERISTIC_UUID,0,0,20,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY), ble(_ble) { - GattCharacteristic *charTable[] = {&rtcCharacteristic, &sampleTimeCharacteristic, &subjectLabelCharacteristic, &twentyFourHourCharacteristic, &runModeCharacteristic}; //Set up characteristics to be broadcasted with the UPAS service + GattCharacteristic *charTable[] = {&rtcCharacteristic, &sampleTimeCharacteristic, &subjectLabelCharacteristic, &runReadyCharacteristic, &runModeCharacteristic}; //Set up characteristics to be broadcasted with the UPAS service GattService upasService(UPAS_Service::UPAS_SERVICE_UUID, charTable, sizeof(charTable) / sizeof(GattCharacteristic *)); //Finally, construct the service ble.gattServer().addService(upasService); }