aboutsummaryrefslogtreecommitdiff
path: root/apps/SoilMoisture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/SoilMoisture.cpp')
-rw-r--r--apps/SoilMoisture.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/SoilMoisture.cpp b/apps/SoilMoisture.cpp
index 3129564..fcf81bd 100644
--- a/apps/SoilMoisture.cpp
+++ b/apps/SoilMoisture.cpp
@@ -62,18 +62,18 @@ void createSetUpdateInterval(ByteBuffer buffer, uint8_t sensor, uint8_t interval
.write8(interval_in_seconds);
}
-SoilMoisture SoilMoisture::create(shared_ptr<BluetoothGatt> gatt) {
+SoilMoisture SoilMoisture::create(BluetoothGattPtr gatt) {
gatt->discoverServices();
- o<shared_ptr<BluetoothGattService>> s = gatt->findService(soil_moisture_service);
+ auto s = gatt->findService(soil_moisture_service);
if (!s) {
throw runtime_error("The device is missing the soil moisture service");
}
- shared_ptr<BluetoothGattService> &service = *s;
+ auto &service = *s;
- o<shared_ptr<BluetoothGattCharacteristic>> c = service->findCharacteristic(soil_moisture_characteristic);
+ auto c = service->findCharacteristic(soil_moisture_characteristic);
if (!c) {
throw runtime_error("The device is missing the soil moisture characteristic");
@@ -86,8 +86,8 @@ SoilMoisture SoilMoisture::create(shared_ptr<BluetoothGatt> gatt) {
return SoilMoisture(gatt, service, c.operator*(), temperature, light);
}
-SoilMoisture::SoilMoisture(const shared_ptr<BluetoothGatt> &gatt,
- const shared_ptr<BluetoothGattService> &s,
+SoilMoisture::SoilMoisture(const BluetoothGattPtr &gatt,
+ const BluetoothGattServicePtr &s,
const BluetoothGattCharacteristicPtr &soilMoistureCharacteristic,
const o<BluetoothGattCharacteristicPtr> temperatureCharacteristic,
const o<BluetoothGattCharacteristicPtr> lightCharacteristic)
@@ -192,5 +192,5 @@ void SoilMoisture::setLight(uint8_t light, uint8_t value) {
bitset<8> b0 = responseBytes.read8();
}
-}
-}
+} // namespace sensor
+} // namespace trygvis