#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include "gdatalogger/gqueue.h"
#include "gdatalogger/gmatlabdatafile.h"
#include "gdatalogger/gdatalogger.h"
#include "communication/communication.h"
#include "datalogger.h"
Go to the source code of this file.
Functions | |
int | datalogger_lock_mutex (void) |
int | datalogger_unlock_mutex (void) |
int | datalogger_init (void) |
int | datalogger_close (void) |
int | datalogger_write_file (void) |
int | datalogger_update_IPC (void) |
int | datalogger_update (double t_s, double t_control_exec_s, double t_ui_exec_s, double t0_s, IMU_DATA_STRUCT *pimu_data, EFF_DATA_STRUCT *peff_data, MRA_DATA_STRUCT *pmra_data) |
int | datalogger_set_Ts (double Ts) |
int | datalogger_status (void) |
int | datalogger_start (void) |
int | datalogger_stop (void) |
int | datalogger_file_exists (const char *filename) |
Variables | |
GDATALOGGER | gDataLogger |
unsigned int | datalogger_initialized = DATALOGGER_NOT_INITIALIZED |
unsigned int | datalogger_running = DATALOGGER_NOT_RUNNING |
pthread_mutex_t | datalogger_mutex = PTHREAD_MUTEX_INITIALIZER |
int datalogger_close | ( | void | ) |
Definition at line 215 of file datalogger.c.
References DATALOGGER_ERROR_NOT_INITIALIZED, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), datalogger_mutex, DATALOGGER_NOT_INITIALIZED, DATALOGGER_SUCCESS, datalogger_unlock_mutex(), gDataLogger_Close(), and gDataLogger_MatfileUpdate().
Referenced by main(), and threads_linux_init().
int datalogger_file_exists | ( | const char * | filename | ) |
Definition at line 618 of file datalogger.c.
References DATALOGGER_FAILURE, and DATALOGGER_SUCCESS.
Referenced by datalogger_init().
int datalogger_init | ( | void | ) |
Definition at line 41 of file datalogger.c.
References DATALOGGER_FAILURE, datalogger_file_exists(), DATALOGGER_FILE_NAME, DATALOGGER_FOLDER, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), DATALOGGER_LOG_CALIBRATED_IMU, DATALOGGER_LOG_EFFORTS, DATALOGGER_LOG_EXECTIMES, DATALOGGER_LOG_MRA, DATALOGGER_LOG_RAW_IMU, DATALOGGER_LOG_TIME, datalogger_mutex, DATALOGGER_NOT_RUNNING, datalogger_running, DATALOGGER_STANDARD_QUEUE_SIZE, DATALOGGER_SUCCESS, datalogger_unlock_mutex(), gDataLogger_DeclareVariable(), gDataLogger_Init(), and gDataLogger_InsertVariable().
Referenced by main(), and threads_linux_init().
int datalogger_lock_mutex | ( | void | ) |
Definition at line 629 of file datalogger.c.
References datalogger_mutex, and DATALOGGER_SUCCESS.
Referenced by datalogger_close(), datalogger_init(), datalogger_set_Ts(), datalogger_start(), datalogger_status(), datalogger_stop(), datalogger_update(), datalogger_update_IPC(), and datalogger_write_file().
int datalogger_set_Ts | ( | double | Ts | ) |
Definition at line 540 of file datalogger.c.
References DATALOGGER_ERROR_NOT_INITIALIZED, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), DATALOGGER_SUCCESS, datalogger_unlock_mutex(), DATALOGGER_VARIABLE_INSERTED, DATALOGGER_VARIABLE_NOT_INSERTED, DATALOGGER_VARIBALE_ALREADY_INSERTED, and gDataLogger_InsertVariable().
Referenced by control_task(), periodic_task_1(), and threads_linux_periodic_task_1().
int datalogger_start | ( | void | ) |
Definition at line 584 of file datalogger.c.
References DATALOGGER_ERROR_NOT_INITIALIZED, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), datalogger_running, DATALOGGER_RUNNING, DATALOGGER_SUCCESS, and datalogger_unlock_mutex().
Referenced by ui_update().
int datalogger_status | ( | void | ) |
Definition at line 571 of file datalogger.c.
References DATALOGGER_ERROR_NOT_INITIALIZED, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), datalogger_running, and datalogger_unlock_mutex().
Referenced by control_task(), main(), periodic_task_1(), threads_linux_init(), threads_linux_periodic_task_1(), ui_overview_data(), and ui_update().
int datalogger_stop | ( | void | ) |
Definition at line 601 of file datalogger.c.
References DATALOGGER_ERROR_NOT_INITIALIZED, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), DATALOGGER_NOT_RUNNING, datalogger_running, DATALOGGER_SUCCESS, and datalogger_unlock_mutex().
Referenced by main(), and ui_update().
int datalogger_unlock_mutex | ( | void | ) |
Definition at line 639 of file datalogger.c.
References datalogger_mutex, and DATALOGGER_SUCCESS.
Referenced by datalogger_close(), datalogger_init(), datalogger_set_Ts(), datalogger_start(), datalogger_status(), datalogger_stop(), datalogger_update(), datalogger_update_IPC(), and datalogger_write_file().
int datalogger_update | ( | double | t_s, |
double | t_control_exec_s, | ||
double | t_ui_exec_s, | ||
double | t0_s, | ||
IMU_DATA_STRUCT * | pimu_data, | ||
EFF_DATA_STRUCT * | peff_data, | ||
MRA_DATA_STRUCT * | pmra_data | ||
) |
Definition at line 272 of file datalogger.c.
References IMU_DATA_STRUCT::acc, IMU_DATA_STRUCT::calibrated::acc, IMU_DATA_STRUCT::calib, DATALOGGER_ERROR_NOT_INITIALIZED, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), DATALOGGER_SUCCESS, datalogger_unlock_mutex(), EFF_DATA_STRUCT::F, gDataLogger_InsertVariable(), IMU_DATA_STRUCT::gyr, IMU_DATA_STRUCT::calibrated::gyr, IMU_DATA_STRUCT::mag, IMU_DATA_STRUCT::calibrated::mag, IMU_DATA_STRUCT::new_data, EFF_DATA_STRUCT::new_data, MRA_DATA_STRUCT::v_ctl, MRA_DATA_STRUCT::v_ctl_read, DATA_XYZ::x, DATA_XYZ_DOUBLE::x, DATA_XYZ::y, DATA_XYZ_DOUBLE::y, DATA_XYZ::z, and DATA_XYZ_DOUBLE::z.
Referenced by control_task(), periodic_task_1(), and threads_linux_periodic_task_1().
int datalogger_update_IPC | ( | void | ) |
Definition at line 256 of file datalogger.c.
References DATALOGGER_ERROR_NOT_INITIALIZED, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), DATALOGGER_SUCCESS, datalogger_unlock_mutex(), and gDataLogger_IPCUpdate().
Referenced by threads_linux_init().
int datalogger_write_file | ( | void | ) |
Definition at line 240 of file datalogger.c.
References DATALOGGER_ERROR_NOT_INITIALIZED, DATALOGGER_INITIALIZED, datalogger_initialized, datalogger_lock_mutex(), DATALOGGER_SUCCESS, datalogger_unlock_mutex(), and gDataLogger_MatfileUpdate().
Referenced by main(), and threads_linux_init().
unsigned int datalogger_initialized = DATALOGGER_NOT_INITIALIZED |
Definition at line 29 of file datalogger.c.
Referenced by datalogger_close(), datalogger_init(), datalogger_set_Ts(), datalogger_start(), datalogger_status(), datalogger_stop(), datalogger_update(), datalogger_update_IPC(), and datalogger_write_file().
pthread_mutex_t datalogger_mutex = PTHREAD_MUTEX_INITIALIZER |
Definition at line 34 of file datalogger.c.
Referenced by datalogger_close(), datalogger_init(), datalogger_lock_mutex(), and datalogger_unlock_mutex().
unsigned int datalogger_running = DATALOGGER_NOT_RUNNING |
Definition at line 30 of file datalogger.c.
Referenced by datalogger_init(), datalogger_start(), datalogger_status(), and datalogger_stop().
GDATALOGGER gDataLogger |
Definition at line 28 of file datalogger.c.