SmartCradle v1
Baby smart cradle
database.h File Reference

Database module header. More...

#include </home/carvalho/Downloads/buildroot/buildroot-2021.02.6/output/host/include/python3.9/Python.h>
Include dependency graph for database.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERROR   7
 

Functions

int initDatabase ()
 Initializes all the functions. More...
 
int send_temp_hum (float temp, float hum)
 Update temperature and humidity in database. More...
 
int get_swing_flag ()
 Get the swing flag from database. More...
 
int get_live_flag ()
 Get the live flag from database. More...
 
int send_notification_flag (int notification_flag)
 Update notification flag in database. More...
 
int send_swing_flag (int swing_flag)
 Update swing flag in database. More...
 

Detailed Description

Database module header.

Author
José Carvalho, João Carneiro
Date
2022-01-13

Definition in file database.h.

Macro Definition Documentation

◆ ERROR

#define ERROR   7

Definition at line 15 of file database.h.

Function Documentation

◆ get_live_flag()

int get_live_flag ( )

Get the live flag from database.

Returns
int : 1 on success, -ERROR or 0 on error

Definition at line 60 of file database.c.

◆ get_swing_flag()

int get_swing_flag ( )

Get the swing flag from database.

Returns
int : 1 on success, -ERROR or 0 on error

Definition at line 32 of file database.c.

◆ initDatabase()

int initDatabase ( )

Initializes all the functions.

Returns
int : 1 on success, -ERROR or 0 on error

Definition at line 121 of file database.c.

◆ send_notification_flag()

int send_notification_flag ( int  notification_flag)

Update notification flag in database.

Parameters
notification_flag: 1 (set) or 0 (reset)
Returns
int : 1 on success, 0 on error

Definition at line 89 of file database.c.

◆ send_swing_flag()

int send_swing_flag ( int  swing_flag)

Update swing flag in database.

Parameters
swing_flag: 1 (set) or 0 (reset)
Returns
int : 1 on success, 0 on error

Definition at line 105 of file database.c.

◆ send_temp_hum()

int send_temp_hum ( float  temp,
float  hum 
)

Update temperature and humidity in database.

Parameters
tempTemperature
humHumidity
Returns
int : 1 on success, 0 on error

Definition at line 16 of file database.c.