lazybios 3.0.0
Lightweight SMBIOS/DMI parsing library
Loading...
Searching...
No Matches
type28.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: LGPL-2.1-or-later
3 *
4 * This file is part of lazybios.
5 *
6 * lazybios is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * lazybios is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with lazybios. If not, see <https://www.gnu.org/licenses/>.
18 */
19/**
20 * @file type28.h
21 * @brief Public API for SMBIOS Type 28 Temperature Probe.
22 * @author LazySeldi
23 */
24
25#ifndef LAZYBIOS_TYPE28_H
26#define LAZYBIOS_TYPE28_H
27
28#ifndef LAZYBIOS_SHARED_API_H
29#define LAZYBIOS_TYPE_HEADER_ONLY
30#include "lazybios/lazybios.h"
31#undef LAZYBIOS_TYPE_HEADER_ONLY
32#endif
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38/** @brief Availability metadata for SMBIOS Type 28 fields. */
50
51/**
52 * @brief Decoded forms of the Type 28 encoded fields.
53 *
54 * Each member holds the decoded form of the raw field it is named for.
55 * Consult the matching `field_status` member before using one.
56 */
57typedef struct {
58 const char* location;
59 const char* status;
61
62/**
63 * @brief Parsed SMBIOS Type 28 Temperature Probe information.
64 * @ingroup api_type28
65 */
66typedef struct {
67 uint16_t handle;
68 uint8_t length;
69 const char* description;
71 uint16_t maximum_value;
72 /** Tenths of a degree C; `INT16_MIN` (`0x8000` on the wire) means unknown. */
74 uint16_t resolution;
75 uint16_t tolerance;
76 uint16_t accuracy;
77 uint32_t oem_defined;
78 uint16_t nominal_value;
82
83/**
84 * @brief A parsed set of SMBIOS Type 28 structures.
85 * @ingroup api_type28
86 */
91
92/** @addtogroup api_type28
93 * @{
94 */
95
96/**
97 * @brief Parses all SMBIOS Type 28 structures.
98 * @param DMIData Raw DMI table container to parse.
99 * @return Newly allocated set, empty when the table holds no Type 28 structure,
100 * or NULL when the arguments are unusable or an allocation fails.
101 */
103
104/**
105 * @brief Releases a parsed set of SMBIOS Type 28 structures.
106 * @param Type28 Set to release; may be NULL.
107 */
109
110/** @} */
111
112#ifdef __cplusplus
113}
114#endif
115
116#endif
LAZYBIOS_WARN_UNUSED lazybiosType28Array_t * lazybiosGetType28(const lazybiosDMI_t *DMIData)
Parses all SMBIOS Type 28 structures.
void lazybiosFreeType28(lazybiosType28Array_t *Type28)
Releases a parsed set of SMBIOS Type 28 structures.
Public API for lazybios. Include this and nothing else.
uint8_t lazybiosFieldStatus_t
Storage for one field's availability.
Definition lazybios.h:115
#define LAZYBIOS_WARN_UNUSED
Expands to nothing on compilers without a return-value check.
Definition lazybios.h:150
Owns raw DMI table data and its parsed SMBIOS entry point.
Definition lazybios.h:218
A parsed set of SMBIOS Type 28 structures.
Definition type28.h:87
lazybiosType28_t * entries
Definition type28.h:88
Decoded forms of the Type 28 encoded fields.
Definition type28.h:57
const char * status
Definition type28.h:59
const char * location
Definition type28.h:58
Availability metadata for SMBIOS Type 28 fields.
Definition type28.h:39
lazybiosFieldStatus_t resolution
Definition type28.h:44
lazybiosFieldStatus_t minimum_value
Definition type28.h:43
lazybiosFieldStatus_t maximum_value
Definition type28.h:42
lazybiosFieldStatus_t tolerance
Definition type28.h:45
lazybiosFieldStatus_t location_and_status
Definition type28.h:41
lazybiosFieldStatus_t oem_defined
Definition type28.h:47
lazybiosFieldStatus_t accuracy
Definition type28.h:46
lazybiosFieldStatus_t description
Definition type28.h:40
lazybiosFieldStatus_t nominal_value
Definition type28.h:48
Parsed SMBIOS Type 28 Temperature Probe information.
Definition type28.h:66
const char * description
Definition type28.h:69
uint16_t tolerance
Definition type28.h:75
lazybiosType28Decoded_t decoded
Definition type28.h:79
uint16_t resolution
Definition type28.h:74
uint32_t oem_defined
Definition type28.h:77
lazybiosType28FieldStatus_t field_status
Definition type28.h:80
uint16_t nominal_value
Definition type28.h:78
int16_t minimum_value
Definition type28.h:73
uint16_t accuracy
Definition type28.h:76
uint8_t length
Definition type28.h:68
uint8_t location_and_status
Definition type28.h:70
uint16_t handle
Definition type28.h:67
uint16_t maximum_value
Definition type28.h:71