Code supports writing to the SD card as well as working with the Volckens group smartphone apps for the mbed HRM1017

Dependencies:   ADS1115 BLE_API BME280 Calibration CronoDot EEPROM LSM303 MCP40D17 NCP5623BMUTBG SDFileSystem SI1145 STC3100 mbed nRF51822

Fork of UPAS_BLE_and_USB by Volckens Group Sensors

Files at this revision

API Documentation at this revision

Comitter:
jelord
Date:
Mon Jan 11 20:42:03 2016 +0000
Parent:
98:d70ff5a0b2e6
Child:
100:da71436aa52a
Commit message:
Name of multiple UPAS can now be distinguished by app

Changed in this revision

UPAS_Service.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/UPAS_Service.h	Sat Jan 09 00:13:17 2016 +0000
+++ b/UPAS_Service.h	Mon Jan 11 20:42:03 2016 +0000
@@ -26,6 +26,9 @@
 
     const static uint16_t FLOWRATE_CHARACTERISTIC_UUID              = 0xA007; //UUID of variable that app will read from
     GattCharacteristic                flowRateCharacteristic;
+    
+    //const static uint16_t BLOWER_CHARACTERISTIC_UUID              = 0xA008; //UUID of variable that app will read from
+//    GattCharacteristic                blowerCharacteristic;
 
 
     UPAS_Service(BLEDevice &_ble, bool placeholder, uint8_t *rtc, uint8_t *sampleTime, uint8_t *subjectLabel, uint8_t *logInterval, uint8_t *flowRate) :
--- a/main.cpp	Sat Jan 09 00:13:17 2016 +0000
+++ b/main.cpp	Mon Jan 11 20:42:03 2016 +0000
@@ -274,14 +274,15 @@
     RTC.get_time();
     uint8_t rtcPassValues[6] = {RTC.seconds, RTC.minutes,RTC.hour,RTC.date,RTC.month,RTC.year};
     uint8_t sampleTimePassValues[12] = {0,};
-    uint8_t subjectLabelOriginal[15] = {0,};
+    uint8_t subjectLabelOriginal[8] = {0,};
     uint8_t dataLogOriginal[1] = {0,};
     uint8_t flowRateOriginal[4] = {0,};
+    //uint8_t blowerOff[1] = {0,};
     E2PROM.read(0x00015, sampleTimePassValues, 12);
-    E2PROM.read(0x00001, subjectLabelOriginal,15);
+    E2PROM.read(0x00001, subjectLabelOriginal,8);
     E2PROM.read(0x00014,dataLogOriginal,1);
     E2PROM.read(0x00010,flowRateOriginal,4);
-    
+    //const static uint8_t NEW_DEVICE_NAME[] = subjectLabelOriginal;
     ble.init();
     ble.onDisconnection(disconnectionCallback);
     ble.onDataWritten(WrittenHandler); //add writeCharCallback (custom function) to whenever data is being written to device
@@ -297,7 +298,7 @@
         
     ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
     ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, (uint8_t *)uuid16_list, sizeof(uuid16_list));
-    ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME));
+    ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)subjectLabelOriginal, sizeof(subjectLabelOriginal));
     ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
     ble.setAdvertisingInterval(160); /* 160ms. */
     ble.startAdvertising();