Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sol-power-supply.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Soletta (TM) Project
3  *
4  * Copyright (C) 2015 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 
21 #include <stdlib.h>
22 
23 #include <sol-vector.h>
24 #include <sol-buffer.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
58 };
59 
71 };
72 
89 };
90 
101 int sol_power_supply_get_list(struct sol_ptr_vector *list);
102 
114 
129 
141 int sol_power_supply_get_type(const char *name, enum sol_power_supply_type *type);
142 
155 int sol_power_supply_exists(const char *name, bool *exist);
156 
174 int sol_power_supply_is_online(const char *name, bool *online);
175 
190 int sol_power_supply_is_present(const char *name, bool *present);
191 
205 int sol_power_supply_get_status(const char *name, enum sol_power_supply_status *status);
206 
220 int sol_power_supply_get_capacity(const char *name, int *capacity);
221 
241 int sol_power_supply_get_capacity_level(const char *name, enum sol_power_supply_capacity_level *capacity_level);
242 
255 int sol_power_supply_get_model_name(const char *name, struct sol_buffer *model_name_buf);
256 
269 int sol_power_supply_get_manufacturer(const char *name, struct sol_buffer *manufacturer_buf);
270 
283 int sol_power_supply_get_serial_number(const char *name, struct sol_buffer *serial_number_buf);
284 
308 int sol_power_supply_get_voltage(const char *name, int *voltage);
309 
324 int sol_power_supply_get_min_voltage(const char *name, int *voltage);
325 
340 int sol_power_supply_get_max_voltage(const char *name, int *voltage);
341 
356 int sol_power_supply_get_min_voltage_design(const char *name, int *voltage);
357 
372 int sol_power_supply_get_max_voltage_design(const char *name, int *voltage);
373 
378 #ifdef __cplusplus
379 }
380 #endif
int sol_power_supply_get_type(const char *name, enum sol_power_supply_type *type)
Get type of power supply (battery, USB, ...)
Definition: sol-power-supply.h:67
int sol_power_supply_get_voltage(const char *name, int *voltage)
Get current voltage.
Definition: sol-power-supply.h:50
int sol_power_supply_get_capacity(const char *name, int *capacity)
Get power supply capacity percentage.
Definition: sol-power-supply.h:57
Definition: sol-power-supply.h:85
Definition: sol-power-supply.h:86
int sol_power_supply_get_status(const char *name, enum sol_power_supply_status *status)
Get power supply status (charging, discharging, not charging, full).
int sol_power_supply_get_list_by_type(struct sol_ptr_vector *list, enum sol_power_supply_type type)
Retrieves a list of names of all power supplies found that match a specified type.
sol_power_supply_status
Power supply charging status.
Definition: sol-power-supply.h:65
Definition: sol-power-supply.h:69
int sol_power_supply_get_serial_number(const char *name, struct sol_buffer *serial_number_buf)
Get serial number of a given power supply.
int sol_power_supply_get_capacity_level(const char *name, enum sol_power_supply_capacity_level *capacity_level)
Get capacity level, as provided by driver (critical, low, normal, high, full).
Definition: sol-power-supply.h:56
int sol_power_supply_get_model_name(const char *name, struct sol_buffer *model_name_buf)
Get model name of a given power supply.
These are routines that Soletta provides for its buffer implementation.
int sol_power_supply_get_manufacturer(const char *name, struct sol_buffer *manufacturer_buf)
Get manufacturer of a given power supply.
Definition: sol-power-supply.h:54
Definition: sol-power-supply.h:51
Definition: sol-power-supply.h:52
int sol_power_supply_is_online(const char *name, bool *online)
Check if a power supply is online.
Definition: sol-power-supply.h:55
int sol_power_supply_get_max_voltage(const char *name, int *voltage)
Get maximum voltage measured by hardware.
Definition: sol-power-supply.h:53
sol_power_supply_type
Type of power supply.
Definition: sol-power-supply.h:49
int sol_power_supply_free_list(struct sol_ptr_vector *list)
Free a list of power supply names.
int sol_power_supply_is_present(const char *name, bool *present)
Check if a power supply is present.
Definition: sol-power-supply.h:84
Soletta pointer vector is a wrapper around vector with an API more convenient to handle pointers...
Definition: sol-vector.h:310
int sol_power_supply_get_max_voltage_design(const char *name, int *voltage)
Get value of voltage when supply is full as defined by design.
Definition: sol-power-supply.h:83
int sol_power_supply_get_min_voltage(const char *name, int *voltage)
Get minimum voltage measured by hardware.
Definition: sol-power-supply.h:66
Definition: sol-power-supply.h:88
These are routines that Soletta provides for its vector implementation.
A sol_buffer is a dynamic array, that can be resized if needed.
Definition: sol-buffer.h:130
int sol_power_supply_get_min_voltage_design(const char *name, int *voltage)
Get value of voltage when supply is empty as defined by design.
Definition: sol-power-supply.h:68
sol_power_supply_capacity_level
Power supply capacity level.
Definition: sol-power-supply.h:82
Definition: sol-power-supply.h:70
int sol_power_supply_exists(const char *name, bool *exist)
Check if a given power supply can be found.
Definition: sol-power-supply.h:87
int sol_power_supply_get_list(struct sol_ptr_vector *list)
Retrieves a list of names of all power supplies found.