bmsd/mysql.h

Mon, 21 Jan 2019 20:45:18 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 21 Jan 2019 20:45:18 +0100
changeset 194
d202777ebae5
parent 0
033898178630
child 405
ef3f0274a1ea
permissions
-rw-r--r--

Added design notes for the csv log format from fermenters. In bmsd configuration added the web_root entry. Switched fermenter DLOG messages to store the log in flat csv files instead of the database. This is much faster and the graphs look better.

/**
 * @file mysql.h
 */
#ifndef _MYSQL_H
#define _MYSQL_H


/**
 * @brief Connect to the MySQL server and select the database. All parameters must be
 *        set in the $HOME/.bms/bms.conf file.
 * @return 0 if success, any other value if the connection failed.
 */
int  bms_mysql_init(void);

/**
 * @brief Close MySQL connection and free resources.
 */
void bms_mysql_end(void);

/**
 * @brief Ping MySQL connection and try to reconnect if the connection is broken.
 */
void bms_mysql_ping(void);

void node_mysql_insert(sys_node_list *node);
void node_mysql_update(sys_node_list *node);
void node_mysql_death(char *node);

void fermenter_mysql_insert(sys_fermenter_list *fermenter);
void fermenter_mysql_update(sys_fermenter_list *fermenter);
void fermenter_mysql_death(char *node, char *alias);


#endif

mercurial