RocketLogger  1.1.6
rl_lib.h File Reference
#include "lib_util.h"
#include "rl_hw.h"
#include "types.h"
#include "util.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

rl_state rl_get_status (void)
 
int rl_read_status (struct rl_status *status)
 
void rl_read_calibration (struct rl_calibration *calibration_ptr, struct rl_conf *conf)
 
int rl_start (struct rl_conf *conf, char *file_comment)
 
int rl_stop (void)
 

Function Documentation

rl_state rl_get_status ( void  )

Copyright (c) 2016-2019, Swiss Federal Institute of Technology (ETH Zurich) 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.

Copyright (c) 2016-2019, Swiss Federal Institute of Technology (ETH Zurich) 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. Get status of RocketLogger

Returns
current status rl_state

Definition at line 38 of file rl_lib.c.

References FAILURE, get_pid(), read_status(), RL_OFF, and rl_status::state.

Referenced by main(), and rl_stop().

+ Here is the call graph for this function:

void rl_read_calibration ( struct rl_calibration calibration_ptr,
struct rl_conf conf 
)

Read calibration file

Parameters
calibration_ptrPointer to rl_calibration to write to
confCurrent rl_conf configuration

Definition at line 79 of file rl_lib.c.

References calibration, and read_calibration().

Referenced by print_status().

+ Here is the call graph for this function:

int rl_read_status ( struct rl_status status)

Read status of RocketLogger

Parameters
statusPointer to rl_status struct to write to
Returns
current status rl_state

Definition at line 60 of file rl_lib.c.

References FAILURE, get_pid(), read_status(), RL_OFF, and rl_status::state.

Referenced by main().

+ Here is the call graph for this function:

int rl_start ( struct rl_conf conf,
char *  file_comment 
)

RocketLogger start function: start sampling

Parameters
confPointer to desired rl_conf configuration
file_commentComment to store in the file header
Returns
SUCCESS in case of success, FAILURE otherwise

Definition at line 91 of file rl_lib.c.

References rl_conf::ambient, AMBIENT_DISABLED, AMBIENT_ENABLED, check_sample_rate(), check_update_rate(), CONTINUOUS, rl_conf::enable_web_server, rl_ambient::enabled, ERROR, FAILURE, rl_conf::file_format, hw_close(), hw_init(), hw_sample(), INFO, LIMIT, METER, METER_UPDATE_RATE, MIN_ADC_RATE, rl_conf::mode, NO_FILE, rl_log(), rl_conf::sample_limit, rl_conf::sample_rate, rl_ambient::sensor_count, set_pid(), sig_handler(), SUCCESS, rl_conf::update_rate, and WARNING.

Referenced by main().

+ Here is the call graph for this function:

int rl_stop ( void  )

RocketLogger stop function (to stop continuous mode)

Returns
SUCCESS in case of success, FAILURE otherwise

Definition at line 180 of file rl_lib.c.

References ERROR, FAILURE, get_pid(), rl_get_status(), rl_log(), RL_RUNNING, and SUCCESS.

Referenced by main().

+ Here is the call graph for this function: