RocketLogger  2.0.0
rl_lib.h File Reference
#include "rl.h"
+ Include dependency graph for rl_lib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool rl_is_sampling (void)
 
int rl_get_status (rl_status_t *const status)
 
int rl_run (rl_config_t *const config)
 
int rl_stop (void)
 

Function Documentation

◆ rl_get_status()

int rl_get_status ( rl_status_t *const  status)

Get the current status of the RocketLogger.

Parameters
statusThe status data structure to write to
Returns
Returns 0 on success, negative on failure with errno set accordingly

Definition at line 77 of file rl_lib.c.

References rl_status::disk_free, rl_status::disk_free_permille, fs_space_free(), fs_space_total(), RL_CONFIG_FILE_DIR_DEFAULT, rl_status_read(), and rl_status_reset().

Referenced by rl_is_sampling().

+ Here is the call graph for this function:

◆ rl_is_sampling()

bool rl_is_sampling ( void  )

Copyright (c) 2016-2020, ETH Zurich, Computer Engineering Group All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Check whether RocketLogger is sampling.

Returns
The current sampling status

Definition at line 59 of file rl_lib.c.

References rl_get_status(), rl_log(), RL_LOG_ERROR, rl_status_reset(), and rl_status::sampling.

Referenced by rl_run(), and rl_stop().

+ Here is the call graph for this function:

◆ rl_run()

int rl_run ( rl_config_t *const  config)

Run a new RocketLogger measurement.

Returns when done unless configured to run in background in which case it returns after successful start.

Parameters
configConfiguration of the measurement to run
Returns
Returns 0 on success, negative on failure with errno set accordingly

Definition at line 100 of file rl_lib.c.

References ERROR, rl_is_sampling(), rl_log(), and RL_LOG_ERROR.

Referenced by adc_calibrate().

+ Here is the call graph for this function:

◆ rl_stop()

int rl_stop ( void  )

RocketLogger stop function (to stop a measurement run in background).

Sends stop signal to running RocketLogger process to terminate.

Returns
Returns 0 on success, negative on failure with errno set accordingly

Definition at line 185 of file rl_lib.c.

References ERROR, rl_is_sampling(), rl_log(), RL_LOG_ERROR, rl_pid_get(), and SUCCESS.

+ Here is the call graph for this function: