STIMA  3
db_thread.h
1 
2 #ifndef DB_THREAD_H_
3 #define DB_THREAD_H_
4 
5 struct db_data_t {
6  int id;
7  frtosLogging* logger;
8  Queue* dbqueue;
9  Queue* mqttqueue;
10  BinarySemaphore* recoverysemaphore;
11  BinaryQueue* recoveryqueue;
12  dbStatus_t* status;
13  station_t* station;
14 };
15 
16 
17 using namespace cpp_freertos;
18 
19 class dbThread : public Thread {
20 
21  public:
28  dbThread(db_data_t* db_data);
29  ~dbThread();
30  virtual void Cleanup();
31 
32  protected:
33  virtual void Run();
34 
35  private:
36  bool doDb(const mqttMessage_t& );
37  int db_exec( const char*);
38  bool db_obsolete(bool& obsolete);
39  bool db_remove();
40  void db_setup();
41  bool data_purge(const bool flush, int messages);
42  bool data_recovery();
43  bool data_set_recovery();
44  bool db_restart();
45  db_data_t* data;
46  sqlite3 *db;
47  //SdFat SD;
48  uint8_t sqlite_memory[SQLITE_MEMORY]; // allocated memory used by sqlite
49  bool sqlite_status;
50  rpcRecovery_t rpcrecovery;
55  File archiveFile;
56 
57 };
58 
59 #endif
Definition: db_thread.h:19
Definition: typedef.h:191
Definition: db_thread.h:5
Definition: typedef.h:134
Definition: typedef.h:214
Definition: typedef.h:70