-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsdcard.hpp
57 lines (42 loc) · 903 Bytes
/
sdcard.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <SD.h>
#include <FS.h>
#include <sqlite3.h>
#include <sstream>
// ----------------------------
// MicroSD Card Reader pins
// ----------------------------
#define CS 5
// ----------------------------
struct MicroSDCardReader
{
public:
static int initializeMicroSDReader();
static void setLastError(char* errorMessage);
static char* getLastError();
private:
static char* lastError;
};
class DatabaseReader
{
public:
DatabaseReader(char* path)
{
sqlite3_open_v2((const char*)path, &connection, SQLITE_OPEN_READWRITE, NULL);
};
~DatabaseReader()
{
sqlite3_close(connection);
};
int queryDatabase(char* query, int (*callback)(void *, int, char **, char **));
void setLastError(char* errorMessage)
{
lastError = errorMessage;
};
char* getLastError()
{
return lastError;
};
private:
char* lastError;
static sqlite3* connection;
};