CoffeePi
Coffee machine control for Raspberry Pi
|
#include <string>
#include <stdexcept>
#include <cstdio>
#include <stdlib.h>
#include <inttypes.h>
#include <cstdarg>
#include "sqlite/sqlite3.h"
Go to the source code of this file.
Enumerations | |
enum | config_key_t { CRC = 1, AliveCRC = 2, lastTC1 = 3, lastTC2 = 4, lastTC3 = 5, lastTerm = 6, testSlowCnt = 7 } |
Functions | |
int | sqlOpen () |
Opens and initializes a sqlite3 database connection. More... | |
void | sqlClose () |
Closes the database connection. More... | |
int | sqlSetup () |
Sets up the database and creates the needed structure. More... | |
int | sqlExecute (string query) |
Executes a SQL statement. More... | |
int | sqlInsertNode (uint8_t *guid, bool terminal) |
int | sqlReadNodes () |
char * | inttochar (uint8_t *guid) |
Converts the GUID from int to char array. More... | |
uint8_t * | chartoint (const unsigned char *guid) |
Converts the GUID from char to int array. More... | |
uint8_t * | int64to8bit (sqlite_int64 guid) |
Converts the GUID from int64 to int8 array. More... | |
sqlite_int64 | int8to64bit (uint8_t *guid) |
void | sqltest () |
std::string | string_sprintf (const char *format,...) |
Allows the format of printf but returns a string Source: http://codereview.stackexchange.com/questions/52522/mimic-sprintf-with-stdstring-output. More... | |
uint64_t | sqlGetConf (config_key_t id) |
Reads a configuration key from the database. More... | |
int | sqlSetConf (config_key_t id, uint64_t value) |
Saves a configuration key to the database. More... | |
enum config_key_t |
uint8_t* chartoint | ( | const unsigned char * | guid | ) |
Converts the GUID from char to int array.
*guid | Pointer to the char GUID |
uint8_t* int64to8bit | ( | sqlite_int64 | guid | ) |
Converts the GUID from int64 to int8 array.
guid | 64bit GUID |
sqlite_int64 int8to64bit | ( | uint8_t * | guid | ) |
char* inttochar | ( | uint8_t * | guid | ) |
Converts the GUID from int to char array.
*guid | Pointer to the uint8_t GUID |
void sqlClose | ( | ) |
Closes the database connection.
int sqlExecute | ( | string | query | ) |
Executes a SQL statement.
*query | SQL query string |
uint64_t sqlGetConf | ( | config_key_t | id | ) |
Reads a configuration key from the database.
id | Config ID key |
int sqlInsertNode | ( | uint8_t * | guid, |
bool | terminal | ||
) |
int sqlOpen | ( | ) |
Opens and initializes a sqlite3 database connection.
int sqlReadNodes | ( | ) |
int sqlSetConf | ( | config_key_t | id, |
uint64_t | value | ||
) |
Saves a configuration key to the database.
id | Config ID key |
value | Integer value |
int sqlSetup | ( | ) |
Sets up the database and creates the needed structure.
void sqltest | ( | ) |
std::string string_sprintf | ( | const char * | format, |
... | |||
) |
Allows the format of printf but returns a string Source: http://codereview.stackexchange.com/questions/52522/mimic-sprintf-with-stdstring-output.
format | input string as char array |