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.
Dependencies: X_NUCLEO_IKS01A2
Diff: source/ESS.h
- Revision:
- 1:b12ac7b02a21
- Parent:
- 0:9c0e0ac79e75
- Child:
- 2:5da515ba10ff
--- a/source/ESS.h Wed Apr 29 10:42:44 2020 +0000
+++ b/source/ESS.h Wed Apr 29 16:18:37 2020 +0000
@@ -9,7 +9,7 @@
#ifndef __BLE_ENVIRONMENTAL_SENSING_SERVICE_H__
#define __BLE_ENVIRONMENTAL_SENSING_SERVICE_H__
-#include "mbed.h"
+#include <mbed.h>
#include "blecommon.h"
#include "Gap.h"
#include "GattServer.h"
@@ -53,18 +53,18 @@
GattService EnvironmentalService(0x181A, charTable, sizeof(charTable) / sizeof(GattCharacteristic *));
- ble.addService(EnvironmentalService);
+ ble.gattServer().addService(EnvironmentalService);
}
/* Set a new 16-bit value for the humidity measurement. */
void updateHumidity(uint16_t humidity) {
- ble.updateCharacteristicValue(humiditychar.getValueAttribute().getHandle(), (uint8_t *)&humidity, sizeof(uint16_t));
+ ble.gattServer().write(humiditychar.getValueAttribute().getHandle(), (uint8_t *)&humidity, sizeof(uint16_t));
}
/* Set a new 16-bit value for the temperature measurement. */
void updateTemperature(int16_t temperature) {
- ble.updateCharacteristicValue(temperaturechar.getValueAttribute().getHandle(), (uint8_t *)&temperature, sizeof(int16_t));
+ ble.gattServer().write(temperaturechar.getValueAttribute().getHandle(), (uint8_t *)&temperature, sizeof(int16_t));
}