@@ -4290,6 +4290,16 @@ void bluez_device_download(DBusConnection* dbus_conn, const char* adapter_path,
4290
4290
ssOutput << std::dec << std::endl;
4291
4291
}
4292
4292
dbus_message_unref (dbus_msg_write);
4293
+
4294
+ if (ConsoleVerbosity > 0 )
4295
+ ssOutput << " [" << getTimeISO8601 (true ) << " ] " ;
4296
+ ssOutput << " Request Download from device: [" << ba2string (dbusBTAddress) << " ]" ;
4297
+ ssOutput << " " << timeToExcelLocal (TimeDownloadStart-(DataPointsToRequest*60 )) << " " << timeToExcelLocal (TimeDownloadStart);
4298
+ ssOutput << " (" << std::dec << DataPointsToRequest << " )" ;
4299
+ auto downloadtype = GoveeThermometers.find (dbusBTAddress);
4300
+ if (downloadtype != GoveeThermometers.end ())
4301
+ ssOutput << " " << ThermometerType2String (downloadtype->second );
4302
+ ssOutput << std::endl;
4293
4303
}
4294
4304
}
4295
4305
#ifdef OLD_GET_UUIDS
@@ -4716,6 +4726,24 @@ std::string bluez_dbus_msg_iter(DBusMessageIter& array_iter, const bdaddr_t& dbu
4716
4726
if (ConsoleVerbosity > 3 )
4717
4727
ssOutput << " " << Key << " : " << std::boolalpha << bool (value.bool_val );
4718
4728
bluez_in_use = bool (value.bool_val );
4729
+ if (!bool (value.bool_val ))
4730
+ {
4731
+ time_t LastDownloadTime = 0 ;
4732
+ auto RecentDownload = GoveeLastDownload.find (dbusBTAddress);
4733
+ if (RecentDownload != GoveeLastDownload.end ())
4734
+ LastDownloadTime = RecentDownload->second ;
4735
+ if (LastDownloadTime != 0 )
4736
+ {
4737
+ if (!ssOutput.str ().empty ())
4738
+ ssOutput << std::endl << ssStartLine.str ();
4739
+ ssOutput << " Last Download from device: [" << ba2string (dbusBTAddress) << " ] " << timeToExcelLocal (LastDownloadTime);;
4740
+ auto downloadtype = GoveeThermometers.find (dbusBTAddress);
4741
+ if (downloadtype != GoveeThermometers.end ())
4742
+ ssOutput << " " << ThermometerType2String (downloadtype->second );
4743
+ if (ConsoleVerbosity < 1 )
4744
+ ssOutput << std::endl;
4745
+ }
4746
+ }
4719
4747
}
4720
4748
}
4721
4749
else if (!Key.compare (" ServicesResolved" ))
@@ -4818,13 +4846,7 @@ std::string bluez_dbus_msg_iter(DBusMessageIter& array_iter, const bdaddr_t& dbu
4818
4846
LastReportedTime = localTemp.Time ;
4819
4847
}
4820
4848
if (LastReportedTime != 0 )
4821
- {
4822
- auto RecentDownload = GoveeLastDownload.find (dbusBTAddress);
4823
- if (RecentDownload != GoveeLastDownload.end ())
4824
- RecentDownload->second = LastReportedTime;
4825
- else
4826
- GoveeLastDownload.insert_or_assign (dbusBTAddress, LastReportedTime);
4827
- }
4849
+ GoveeLastDownload.insert_or_assign (dbusBTAddress, LastReportedTime);
4828
4850
if (offset < 1 ) // If offset is 6 or less we are in the last bit of data, and as soon as we decode it we can close the connection.
4829
4851
bluez_disconnect = true ;
4830
4852
}
@@ -5078,6 +5100,8 @@ void bluez_dbus_msg_InterfacesAdded(DBusMessage* dbus_msg, bdaddr_t & dbusBTAddr
5078
5100
}
5079
5101
if (ConsoleVerbosity > 1 )
5080
5102
std::cout << ssOutput.str ();
5103
+ else
5104
+ std::cerr << ssOutput.str ();
5081
5105
}
5082
5106
void bluez_dbus_msg_PropertiesChanged (DBusMessage* dbus_msg, bdaddr_t & dbusBTAddress, const std::set<bdaddr_t > & BT_WhiteList, const time_t & TimeNow)
5083
5107
{
@@ -5115,6 +5139,8 @@ void bluez_dbus_msg_PropertiesChanged(DBusMessage* dbus_msg, bdaddr_t& dbusBTAdd
5115
5139
}
5116
5140
if (ConsoleVerbosity > 1 )
5117
5141
std::cout << ssOutput.str ();
5142
+ else
5143
+ std::cerr << ssOutput.str ();
5118
5144
}
5119
5145
// ///////////////////////////////////////////////////////////////////////////
5120
5146
time_t ConnectAndDownload (DBusConnection* dbus_conn, const char * adapter_path, const bdaddr_t & dbusBTAddress, const time_t GoveeLastReadTime = 0 , const int BatteryToRecord = 0 )
0 commit comments