Edgehog Device SDK ESP32
ESP32 device SDK for the Edgehog platform
edgehog_battery_status.h
Go to the documentation of this file.
1 /*
2  * This file is part of Edgehog.
3  *
4  * Copyright 2021,2022 SECO Mind Srl
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  * SPDX-License-Identifier: Apache-2.0
19  */
20 
26 #ifndef EDGEHOG_BATTERY_STATUS_H
27 #define EDGEHOG_BATTERY_STATUS_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include "edgehog_device.h"
34 
35 // clang-format off
36 
40 typedef enum
41 {
51 
52 typedef struct {
53  const char *battery_slot;
58 
59 // clang-format on
60 
72  edgehog_device_handle_t edgehog_device, const edgehog_battery_status_t *battery_status);
73 
81 void edgehog_battery_status_publish(edgehog_device_handle_t edgehog_device);
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif // EDGEHOG_BATTERY_STATUS_H
void edgehog_battery_status_update(edgehog_device_handle_t edgehog_device, const edgehog_battery_status_t *battery_status)
Update battery status info.
edgehog_battery_state
Edgehog Battery state codes.
Definition: edgehog_battery_status.h:41
@ BATTERY_REMOVED
Definition: edgehog_battery_status.h:48
@ BATTERY_IDLE_OR_CHARGING
Definition: edgehog_battery_status.h:46
@ BATTERY_FAILURE
Definition: edgehog_battery_status.h:47
@ BATTERY_INVALID
Definition: edgehog_battery_status.h:42
@ BATTERY_UNKNOWN
Definition: edgehog_battery_status.h:49
@ BATTERY_CHARGING
Definition: edgehog_battery_status.h:44
@ BATTERY_DISCHARGING
Definition: edgehog_battery_status.h:45
@ BATTERY_IDLE
Definition: edgehog_battery_status.h:43
void edgehog_battery_status_publish(edgehog_device_handle_t edgehog_device)
Publish battery status info.
Edgehog device SDK API.
Definition: edgehog_battery_status.h:52
double level_percentage
Definition: edgehog_battery_status.h:54
double level_absolute_error
Definition: edgehog_battery_status.h:55
edgehog_battery_state battery_state
Definition: edgehog_battery_status.h:56
const char * battery_slot
Definition: edgehog_battery_status.h:53