libpowermon 1.12
PowerMon Access Library
Loading...
Searching...
No Matches
powermon_log.h
1/* Copyright (C) 2020 - 2024, Thornwave Labs Inc
2 * Written by Razvan Turiac <razvan.turiac@thornwave.com>
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5 * documentation files (the “Software”), to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
7 * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8 *
9 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10 * Attribution shall be given to Thornwave Labs Inc. and shall be made visible to the final user.
11 *
12 * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
13 * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
14 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
15 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16*/
17
18#ifndef _POWERMON_LOG_H
19#define _POWERMON_LOG_H
20
21
22#include <powermon_config.h>
23
24#include <vector>
25#include <functional>
26#include <math.h>
27
28
33{
34public:
35 struct Sample
36 {
37 uint32_t time;
38 float voltage1;
39 float voltage2;
40 float current;
41 float power;
42 float temperature;
43 uint8_t soc;
44 uint8_t ps;
45 };
46
55 static uint32_t decode(const std::vector<uint8_t> &data, std::vector<Sample> &samples, int32_t tz_index);
56};
57
58#endif
PowermonLogFile is a class representing a PowerMon log file. It also contains support to decode the d...
Definition powermon_log.h:33
static uint32_t decode(const std::vector< uint8_t > &data, std::vector< Sample > &samples, int32_t tz_index)
Decode a log file.
Definition powermon_log.h:36