|
RocketLogger
1.1
|
Include dependency graph for web.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | ringbuffer |
| struct | web_shm |
Macros | |
| #define | WEB_RING_BUFFER_COUNT 3 |
| Number of ring buffers in shared memory. More... | |
| #define | BUF1_INDEX 0 |
| Index of 1s/div buffer. More... | |
| #define | BUF10_INDEX 1 |
| Index of 10s/div buffer. More... | |
| #define | BUF100_INDEX 2 |
| Index of 100s/div buffer. More... | |
| #define | BUFFER1_SIZE 100 |
| Size of 1s/div buffer. More... | |
| #define | BUFFER10_SIZE 10 |
| Size of 10s/div buffer. More... | |
| #define | BUFFER100_SIZE 1 |
| Size of 100s/div buffer. More... | |
| #define | NUM_WEB_CHANNELS 12 |
| Maximum number of channels in web interface (6 analog + 6 digital) More... | |
| #define | NUM_WEB_POINTS 1000 |
| Number of data points in web plot. More... | |
| #define | NUM_WEB_DIVS 10 |
| Number of time divisions in web plot. More... | |
| #define | H_L_SCALE 100 |
| Current high-low scale difference. More... | |
Enumerations | |
| enum | time_scale { S1 = 0, S10 = 1, S100 = 2 } |
Functions | |
| struct web_shm * | web_create_shm (void) |
| struct web_shm * | web_open_shm (void) |
| void | web_buffer_reset (struct ringbuffer *buffer, int element_size, int length) |
| void | web_buffer_add (struct ringbuffer *buffer, int64_t *data) |
| int64_t * | web_buffer_get (struct ringbuffer *buffer, int num) |
| void | web_handle_data (struct web_shm *web_data_ptr, int sem_id, void *buffer_addr, uint32_t sample_data_size, uint32_t samples_count, struct time_stamp *timestamp_realtime, struct rl_conf *conf) |
| #define BUF100_INDEX 2 |
| #define BUF10_INDEX 1 |
| #define BUF1_INDEX 0 |
| #define BUFFER100_SIZE 1 |
Size of 100s/div buffer.
Definition at line 63 of file web.h.
Referenced by pru_sample(), and web_handle_data().
| #define BUFFER10_SIZE 10 |
Size of 10s/div buffer.
Definition at line 61 of file web.h.
Referenced by pru_sample(), and web_handle_data().
| #define BUFFER1_SIZE 100 |
Size of 1s/div buffer.
Definition at line 59 of file web.h.
Referenced by pru_sample(), and web_handle_data().
| #define H_L_SCALE 100 |
Current high-low scale difference.
Definition at line 73 of file web.h.
Referenced by web_merge_currents().
| #define NUM_WEB_CHANNELS 12 |
| #define NUM_WEB_POINTS 1000 |
| #define WEB_RING_BUFFER_COUNT 3 |
Number of ring buffers in shared memory.
Copyright (c) 2016-2017, 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:
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.
Definition at line 41 of file web.h.
Referenced by pru_sample(), and web_handle_data().
| enum time_scale |
| void web_buffer_add | ( | struct ringbuffer * | buffer, |
| int64_t * | data | ||
| ) |
Add element to ring buffer
| buffer | Pointer to ring buffer |
| data | Pointer to data array to add |
Definition at line 112 of file web.c.
References ringbuffer::data, ringbuffer::element_size, ringbuffer::filled, ringbuffer::head, and ringbuffer::length.
Referenced by web_handle_data().
| int64_t* web_buffer_get | ( | struct ringbuffer * | buffer, |
| int | num | ||
| ) |
Get pointer to a specific element of a ringbuffer
| buffer | Pointer to ring buffer |
| num | Element number (0 corresponds to the newest element) |
Definition at line 128 of file web.c.
References ringbuffer::data, ringbuffer::element_size, ringbuffer::head, and ringbuffer::length.
Referenced by print_data().
| void web_buffer_reset | ( | struct ringbuffer * | buffer, |
| int | element_size, | ||
| int | length | ||
| ) |
Reset web data ring buffer
| buffer | Pointer to ring buffer to reset |
| element_size | Desired element size in bytes |
| length | Buffer length in elements |
Definition at line 100 of file web.c.
References ringbuffer::element_size, ringbuffer::filled, ringbuffer::head, and ringbuffer::length.
Referenced by pru_sample().
| struct web_shm* web_create_shm | ( | void | ) |
Copyright (c) 2016-2017, 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:
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. Create shared memory for data exchange with web server
Definition at line 46 of file web.c.
References ERROR, rl_log(), SHMEM_DATA_KEY, SHMEM_PERMISSIONS, and web_data.
Referenced by pru_sample().
Here is the call graph for this function:| void web_handle_data | ( | struct web_shm * | web_data_ptr, |
| int | sem_id, | ||
| void * | buffer_addr, | ||
| uint32_t | sample_data_size, | ||
| uint32_t | samples_count, | ||
| struct time_stamp * | timestamp_realtime, | ||
| struct rl_conf * | conf | ||
| ) |
Process the data buffer for the web interface
| web_data_ptr | Pointer to shared web data |
| sem_id | ID of semaphores for shared web data |
| buffer_addr | Pointer to buffer to handle |
| sample_data_size | Size of samples to read |
| samples_count | Number of samples to read |
| timestamp_realtime | time_stamp with realtime clock value |
| conf | Current rl_conf configuration. |
Definition at line 200 of file web.c.
References BINARY_MASK, BUF100_INDEX, BUF10_INDEX, BUF1_INDEX, web_shm::buffer, BUFFER100_SIZE, BUFFER10_SIZE, BUFFER1_SIZE, calibration, CHANNEL_ENABLED, rl_conf::channels, count_channels(), DATA_SEM, rl_conf::digital_inputs, DIGITAL_INPUTS_ENABLED, rl_conf::enable_web_server, I1L_INDEX, I2L_INDEX, time_stamp::nsec, num_channels, web_shm::num_channels, NUM_CHANNELS, NUM_DIGITAL_INPUTS, NUM_I_CHANNELS, rl_calibration::offsets, PRU_DIG_SIZE, rl_log(), RL_RUNNING, rl_calibration::scales, time_stamp::sec, SEM_WRITE_TIME_OUT, set_sem(), rl_status::state, status, web_shm::time, TIME_OUT, VALID_MASK, wait_sem(), WARNING, web_buffer_add(), web_data, web_merge_currents(), and WEB_RING_BUFFER_COUNT.
Referenced by pru_sample().
Here is the call graph for this function:| struct web_shm* web_open_shm | ( | void | ) |
Open existing shared memory for data exchange with web server
Definition at line 72 of file web.c.
References ERROR, rl_log(), SHMEM_DATA_KEY, SHMEM_PERMISSIONS, and web_data.
Referenced by main().
Here is the call graph for this function: