From 4b144f303f0e36a9dd21e88d360193c960ee1572 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 3 Apr 2018 20:56:09 +0100 Subject: show more progress info --- sensor/thermostat.ino | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sensor/thermostat.ino') diff --git a/sensor/thermostat.ino b/sensor/thermostat.ino index ba98158..52eb4b0 100644 --- a/sensor/thermostat.ino +++ b/sensor/thermostat.ino @@ -69,13 +69,27 @@ uint32_t send_data_and_get_time(BLEAddress* pAddress,String* data) { BLEClient* pClient = BLEDevice::createClient(); show("Sc"); pClient->connect(*pAddress); - show("SC"); + String status = "SC"; + status += pClient->getPeerAddress().toString().c_str(); + show(status); BLERemoteService* pThermoService = pClient->getService(thermo_service_uuid); + if (!pThermoService) { + show("NO SERVICE"); + return 60; + } BLERemoteCharacteristic* pTemp = pThermoService->getCharacteristic(thermo_temp_uuid); + if (!pTemp) { + show("NO TEMP CHAR"); + return 60; + } show("SCw"); pTemp->writeValue(data->c_str(),data->length()); show("SCWr"); BLERemoteCharacteristic* pTime = pThermoService->getCharacteristic(thermo_time_uuid); + if (!pTime) { + show("NO TIME CHAR"); + return 60; + } std::string next_time = pTime->readValue(); show("SCWRd"); pClient->disconnect(); -- cgit v1.2.3