forked from Akcelerometry_drgania_WMT/PI_mikrokontroler
32 lines
729 B
C++
32 lines
729 B
C++
#ifndef UPLOADMANAGER_H
|
|
#define UPLOADMANAGER_H
|
|
|
|
#include <Arduino.h>
|
|
#include <FS.h>
|
|
#include <SD.h>
|
|
#include "APIClient.h"
|
|
#include "RTClib.h"
|
|
#include "Measure.h"
|
|
|
|
class UploadManager {
|
|
public:
|
|
UploadManager(APIClient& client, RTC_DS3231& rtc, DataCapture& capture);
|
|
|
|
// Call this to upload a specific file immediately
|
|
void uploadFile(const String& filePath);
|
|
|
|
// Call this in the background when WiFi is connected
|
|
void processPendingUploads();
|
|
|
|
private:
|
|
APIClient& apiClient;
|
|
RTC_DS3231& rtc_;
|
|
DataCapture& capture_;
|
|
|
|
bool isAlreadyUploaded(const String& filePath);
|
|
void appendLog(const String& filePath, const String& status);
|
|
String getCurrentTimestamp();
|
|
};
|
|
|
|
#endif
|