To apply HAL ABI Versioning, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-battery-types.h
-> Common data types like structures or enums used between the device-battery
HAL-API and HAL-BACKEND
hal-device-battery-interface-1.h
-> Declaration of functions to be implemented in the device-battery HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-battery-interface.h
-> Includes the hal-device-battery-interface-[major].h files for each supported
major version.
hal-device-battery.h
-> Declaration of the device-battery HAL-API functions
Change-Id: Ic2a07101cf70384b803e68f3088f9ea1db22a95b
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_DEVICE_BATTERY_INTERFACE_1_H__
+#define __HAL_DEVICE_BATTERY_INTERFACE_1_H__
+
+#include "hal-device-battery-types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The id of this device
+ */
+#define BATTERY_HARDWARE_DEVICE_ID "battery"
+
+#define POWER_SOURCE_NONE "none"
+#define POWER_SOURCE_AC "ac"
+#define POWER_SOURCE_USB "usb"
+#define POWER_SOURCE_WIRELESS "wireless"
+
+typedef struct _hal_backend_device_battery_funcs {
+ /* Register battery event */
+ int (*register_changed_event)(BatteryUpdated updated_cb, void *data);
+ void (*unregister_changed_event)(BatteryUpdated updated_cb);
+
+ /* Get current states */
+ int (*get_current_state)(BatteryUpdated updated_cb, void *data);
+} hal_backend_device_battery_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_BATTERY_INTERFACE_1_H__ */
#ifndef __HAL_DEVICE_BATTERY_INTERFACE_H__
#define __HAL_DEVICE_BATTERY_INTERFACE_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include "hal-device-battery-types.h"
+#include "hal-device-battery-interface-1.h"
-/**
- * The id of this device
- */
-#define BATTERY_HARDWARE_DEVICE_ID "battery"
-
-#define POWER_SOURCE_NONE "none"
-#define POWER_SOURCE_AC "ac"
-#define POWER_SOURCE_USB "usb"
-#define POWER_SOURCE_WIRELESS "wireless"
-
-struct battery_info {
- char *name;
- char *status;
- char *health;
- char *power_source;
-
- int online;
- int present;
- int capacity;
-
- int current_now;
- int current_average;
- int voltage_now;
- int voltage_average;
- int temperature;
-};
-
-typedef void (*BatteryUpdated)(struct battery_info *info, void *data);
-
-typedef struct _hal_backend_device_battery_funcs {
- /* Register battery event */
- int (*register_changed_event)(BatteryUpdated updated_cb, void *data);
- void (*unregister_changed_event)(BatteryUpdated updated_cb);
-
- /* Get current states */
- int (*get_current_state)(BatteryUpdated updated_cb, void *data);
-} hal_backend_device_battery_funcs;
-
-#ifdef __cplusplus
-}
-#endif
#endif /* __HAL_DEVICE_BATTERY_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_DEVICE_BATTERY_TYPES_H__
+#define __HAL_DEVICE_BATTERY_TYPES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct battery_info {
+ char *name;
+ char *status;
+ char *health;
+ char *power_source;
+
+ int online;
+ int present;
+ int capacity;
+
+ int current_now;
+ int current_average;
+ int voltage_now;
+ int voltage_average;
+ int temperature;
+};
+
+typedef void (*BatteryUpdated)(struct battery_info *info, void *data);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_BATTERY_TYPES_H__ */