Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/AdvancedPublish.cpp (1 of 27 files). Show all
Unified · Split
| @@ -243,7 +243,8 @@ bool RunPublisher(uint16_t port, bool genHistory) · 242 unmodified lines | ||
| 243 | 243 | // data type reasonable random values every 33 milliseconds |
| 244 | 244 | PublishTimer = NewSharedPtr<Timer>(33, [](Timer*, void*) |
| 245 | 245 | { |
| 246 | − static uint32_t count = MeasurementsToPublish.size(); | |
| 246 | + // If metadata can change, the following integer should not be static: | |
| 247 | + static uint32_t count = ConvertUInt32(MeasurementsToPublish.size()); | |
| 247 | 248 | const int64_t timestamp = ToTicks(UtcNow()); |
| 248 | 249 | vector<MeasurementPtr> measurements; |
| 249 | 250 | |