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/ESS2.h
- Revision:
- 1:b12ac7b02a21
- Parent:
- 0:9c0e0ac79e75
--- a/source/ESS2.h Wed Apr 29 10:42:44 2020 +0000 +++ b/source/ESS2.h Wed Apr 29 16:18:37 2020 +0000 @@ -9,7 +9,7 @@ #ifndef __BLE_ENVIRONMENTAL_SENSING_SERVICE2_H__ #define __BLE_ENVIRONMENTAL_SENSING_SERVICE2_H__ -#include "mbed.h" +#include <mbed.h> #include "blecommon.h" #include "Gap.h" #include "GattServer.h" @@ -55,17 +55,17 @@ GattService EnvironmentalService(0x181A, charTable, sizeof(charTable) / sizeof(GattCharacteristic *)); - ble.addService(EnvironmentalService); + ble.gattServer().addService(EnvironmentalService); } /* Set a new 16-bit value for the wind direction measurement. */ void updateWinddirection(uint16_t winddirection) { - ble.updateCharacteristicValue(winddirectionchar.getValueAttribute().getHandle(), (uint8_t *)&winddirection, sizeof(uint16_t)); + ble.gattServer().write(winddirectionchar.getValueAttribute().getHandle(), (uint8_t *)&winddirection, sizeof(uint16_t)); } /* Set a new 32-bit value for the pressure measurement. */ void updatePressure(uint32_t pressure) { - ble.updateCharacteristicValue(pressurechar.getValueAttribute().getHandle(), (uint8_t *)&pressure, sizeof(uint32_t)); + ble.gattServer().write(pressurechar.getValueAttribute().getHandle(), (uint8_t *)&pressure, sizeof(uint32_t)); }