This is the latest working repository used in our demo video for the Maxim to display temperature readings on Bluetooth
Diff: MAXREFDES100FW300/e4a10ed6eb92/HSP/Hsp_BLE/HspBLE.cpp
- Revision:
- 5:bc128a16232f
- Parent:
- 4:1fcd660d72fe
--- a/MAXREFDES100FW300/e4a10ed6eb92/HSP/Hsp_BLE/HspBLE.cpp Sat Apr 10 07:51:22 2021 +0000 +++ b/MAXREFDES100FW300/e4a10ed6eb92/HSP/Hsp_BLE/HspBLE.cpp Sun May 02 23:09:04 2021 +0000 @@ -41,6 +41,7 @@ uint8_t HspBLE::temperatureTopCharUUID[] = {0x35,0x44,0x53,0x1b,0x00,0xc3,0x43,0x42,0x97,0x55,0xb5,0x6a,0xbe,0x8e,0x6c,0x67}; uint8_t HspBLE::temperatureBottomCharUUID[] = {0x35,0x44,0x53,0x1b,0x00,0xc3,0x43,0x42,0x97,0x55,0xb5,0x6a,0xbe,0x8e,0x6a,0x66}; uint8_t HspBLE::accelerometerCharUUID[] = {0xe6,0xc9,0xda,0x1a,0x80,0x96,0x48,0xbc,0x83,0xa4,0x3f,0xca,0x38,0x37,0x05,0xaf}; +// new uint8_t HspBLE::heartrateCharUUID[] = {0x44,0xa3,0xa3,0x44,0xb0,0x93,0x41,0x3c,0x57,0xab,0x3b,0xe4,0xc6,0x48,0xc5,0xd3}; uint8_t HspBLE::heartrateCharUUID[] = {0x62,0x1a,0x00,0xe3,0xb0,0x93,0x46,0xbf,0xaa,0xdc,0xab,0xe4,0xc6,0x48,0xc5,0x69}; uint8_t HspBLE::pressureCharUUID[] = {0x1d,0x8a,0x19,0x32,0xda,0x49,0x49,0xad,0x91,0xd8,0x80,0x08,0x32,0xe7,0xe9,0x40}; uint8_t HspBLE::dataCharUUID[] = {0xaa,0x8a,0x19,0x32,0xda,0x49,0x49,0xad,0x91,0xd8,0x80,0x08,0x32,0xe7,0xe9,0x40}; @@ -90,7 +91,7 @@ printf("BLE DeviceID = %02X:%02X:%02X:%02X:%02X:%02X...\n", serialNumberPtr[0], serialNumberPtr[1], serialNumberPtr[2], serialNumberPtr[3], serialNumberPtr[4], serialNumberPtr[5]); - + printf("Hello2"); bluetoothLE->addCharacteristic(new Characteristic(2 /* number of bytes */,temperatureTopCharUUID,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)); bluetoothLE->addCharacteristic(new Characteristic(2 /* number of bytes */,temperatureBottomCharUUID,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)); bluetoothLE->addCharacteristic(new Characteristic(6 /* number of bytes */,accelerometerCharUUID,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)); @@ -99,6 +100,7 @@ bluetoothLE->addCharacteristic(new Characteristic(32 /* number of bytes */,dataCharUUID,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE)); bluetoothLE->addCharacteristic(new Characteristic(32 /* number of bytes */,ecgCharUUID,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)); //^that's our boy + //ayo8 bluetoothLE->addCharacteristic(new Characteristic(1 /* number of bytes */,commandCharUUID,GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE)); bluetoothLE->initService(serialNumberPtr, deviceName, sizeof(deviceName),envServiceUUID); @@ -131,13 +133,14 @@ } void HspBLE::pollSensor(int sensorId, uint8_t *data) { - +printf("entering switch...."); switch (sensorId) { case CHARACTERISTIC_TEMP_TOP: { uint16_t uShort; Peripherals::max30205_top()->readTemperature(&uShort); data[0] = HIGH_BYTE(uShort); data[1] = LOW_BYTE(uShort); + //printf("%u",data[0]); } break; case CHARACTERISTIC_TEMP_BOTTOM: { uint16_t uShort; @@ -177,6 +180,8 @@ for (i = 0; i < sizeof(MAX30001::max30001_t); i++) data[i] = bytePtr[i]; } break; + + //ayo7 case CHARACTERISTIC_ECG: { int i; uint8_t *bytePtr; @@ -209,5 +214,6 @@ bluetoothLE->notifyCharacteristic(CHARACTERISTIC_PRESSURE, data); pollSensor(CHARACTERISTIC_ECG, data); bluetoothLE->notifyCharacteristic(CHARACTERISTIC_ECG, data); + //ayo2 } }