SmartCradle v1
Baby smart cradle
database.c File Reference

Database C module implementation. More...

#include "../inc/database.h"
Include dependency graph for database.c:

Go to the source code of this file.

Functions

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...
 
int initDatabase ()
 Initializes all the functions. More...
 

Variables

PyObject * pName
 
PyObject * pModule
 
PyObject * pDict
 
PyObject * pFuncSend_notification_flag
 
PyObject * pFuncGet_live_flag
 
PyObject * pFuncGet_swing_flag
 
PyObject * pFuncSend_temp_hum
 
PyObject * pFuncSend_swing_flag
 
PyObject * pResult
 

Detailed Description

Database C module implementation.

Temperature and humidity sensor module implementation.

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

Definition in file database.c.

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.

Variable Documentation

◆ pDict

PyObject * pDict

Definition at line 12 of file database.c.

◆ pFuncGet_live_flag

PyObject * pFuncGet_live_flag

Definition at line 13 of file database.c.

◆ pFuncGet_swing_flag

PyObject * pFuncGet_swing_flag

Definition at line 13 of file database.c.

◆ pFuncSend_notification_flag

PyObject* pFuncSend_notification_flag

Definition at line 13 of file database.c.

◆ pFuncSend_swing_flag

PyObject * pFuncSend_swing_flag

Definition at line 13 of file database.c.

◆ pFuncSend_temp_hum

PyObject * pFuncSend_temp_hum

Definition at line 13 of file database.c.

◆ pModule

PyObject * pModule

Definition at line 12 of file database.c.

◆ pName

PyObject* pName

Definition at line 12 of file database.c.

◆ pResult

PyObject * pResult

Definition at line 13 of file database.c.