Zephyr API 3.6.99
Loading...
Searching...
No Matches
bas.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Demant A/S
3 * Copyright (c) 2018 Nordic Semiconductor ASA
4 * Copyright (c) 2016 Intel Corporation
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#ifndef ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_BAS_H_
10#define ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_BAS_H_
11
22#include <stdint.h>
23#include <zephyr/sys/util.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
45
57
72
87
105
123
144
162
177
189
197
208
215
222
229
236
243
250
257
266
275
284
285#ifdef __cplusplus
286}
287#endif
288
293#endif /* ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_BAS_H_ */
bt_bas_bls_battery_present
Battery Present Status.
Definition bas.h:50
bt_bas_bls_battery_charge_state
Battery Charge State.
Definition bas.h:92
void bt_bas_bls_set_battery_charge_type(enum bt_bas_bls_battery_charge_type type)
Set the battery charge type.
bt_bas_bls_wired_power_source
Wired External Power Source Status.
Definition bas.h:62
void bt_bas_bls_set_battery_present(enum bt_bas_bls_battery_present present)
Set the battery present status.
void bt_bas_bls_set_battery_charge_state(enum bt_bas_bls_battery_charge_state state)
Set the battery charge state.
bt_bas_bls_battery_fault
Battery Fault Status.
Definition bas.h:182
void bt_bas_bls_set_charging_fault_reason(enum bt_bas_bls_charging_fault_reason reason)
Set the charging fault reason.
void bt_bas_bls_set_wired_external_power_source(enum bt_bas_bls_wired_power_source source)
Set the wired external power source status.
bt_bas_bls_flags
Battery Level Status Characteristic flags.
Definition bas.h:35
void bt_bas_bls_set_battery_fault(enum bt_bas_bls_battery_fault value)
Set the battery fault status.
bt_bas_bls_battery_charge_type
Battery Charge Type.
Definition bas.h:128
void bt_bas_bls_set_service_required(enum bt_bas_bls_service_required value)
Set the service required status.
int bt_bas_set_battery_level(uint8_t level)
Update battery level value.
void bt_bas_bls_set_battery_charge_level(enum bt_bas_bls_battery_charge_level level)
Set the battery charge level.
bt_bas_bls_battery_charge_level
Battery Charge Level.
Definition bas.h:110
bt_bas_bls_service_required
Service Required Status.
Definition bas.h:167
bt_bas_bls_charging_fault_reason
Charging Fault Reason.
Definition bas.h:149
uint8_t bt_bas_get_battery_level(void)
Read battery level value.
void bt_bas_bls_set_wireless_external_power_source(enum bt_bas_bls_wireless_power_source source)
Set the wireless external power source status.
bt_bas_bls_wireless_power_source
Wireless External Power Source Status.
Definition bas.h:77
void bt_bas_bls_set_identifier(uint16_t identifier)
Set the identifier of the battery.
@ BT_BAS_BLS_BATTERY_PRESENT
Battery is present.
Definition bas.h:55
@ BT_BAS_BLS_BATTERY_NOT_PRESENT
Battery is not present.
Definition bas.h:52
@ BT_BAS_BLS_CHARGE_STATE_DISCHARGING_INACTIVE
Battery is discharging but inactive.
Definition bas.h:103
@ BT_BAS_BLS_CHARGE_STATE_CHARGING
Battery is currently charging.
Definition bas.h:97
@ BT_BAS_BLS_CHARGE_STATE_UNKNOWN
Battery charge state is unknown.
Definition bas.h:94
@ BT_BAS_BLS_CHARGE_STATE_DISCHARGING_ACTIVE
Battery is discharging actively.
Definition bas.h:100
@ BT_BAS_BLS_WIRED_POWER_UNKNOWN
Wired external power source status is unknown.
Definition bas.h:70
@ BT_BAS_BLS_WIRED_POWER_NOT_CONNECTED
Wired external power source is not connected.
Definition bas.h:64
@ BT_BAS_BLS_WIRED_POWER_CONNECTED
Wired external power source is connected.
Definition bas.h:67
@ BT_BAS_BLS_BATTERY_FAULT_YES
Battery fault present.
Definition bas.h:187
@ BT_BAS_BLS_BATTERY_FAULT_NO
No battery fault.
Definition bas.h:184
@ BT_BAS_BLS_FLAG_IDENTIFIER_PRESENT
Bit indicating that the Battery Level Status identifier is present.
Definition bas.h:37
@ BT_BAS_BLS_FLAG_BATTERY_LEVEL_PRESENT
Bit indicating that the Battery Level is present.
Definition bas.h:40
@ BT_BAS_BLS_FLAG_ADDITIONAL_STATUS_PRESENT
Bit indicating that additional status information is present.
Definition bas.h:43
@ BT_BAS_BLS_CHARGE_TYPE_UNKNOWN
Battery charge type is unknown or not charging.
Definition bas.h:130
@ BT_BAS_BLS_CHARGE_TYPE_CONSTANT_CURRENT
Battery is charged using constant current.
Definition bas.h:133
@ BT_BAS_BLS_CHARGE_TYPE_CONSTANT_VOLTAGE
Battery is charged using constant voltage.
Definition bas.h:136
@ BT_BAS_BLS_CHARGE_TYPE_FLOAT
Battery is charged using float charge.
Definition bas.h:142
@ BT_BAS_BLS_CHARGE_TYPE_TRICKLE
Battery is charged using trickle charge.
Definition bas.h:139
@ BT_BAS_BLS_CHARGE_LEVEL_LOW
Battery charge level is low.
Definition bas.h:118
@ BT_BAS_BLS_CHARGE_LEVEL_CRITICAL
Battery charge level is critical.
Definition bas.h:121
@ BT_BAS_BLS_CHARGE_LEVEL_UNKNOWN
Battery charge level is unknown.
Definition bas.h:112
@ BT_BAS_BLS_CHARGE_LEVEL_GOOD
Battery charge level is good.
Definition bas.h:115
@ BT_BAS_BLS_SERVICE_REQUIRED_TRUE
Service is required.
Definition bas.h:172
@ BT_BAS_BLS_SERVICE_REQUIRED_FALSE
Service is not required.
Definition bas.h:169
@ BT_BAS_BLS_SERVICE_REQUIRED_UNKNOWN
Service requirement is unknown.
Definition bas.h:175
@ BT_BAS_BLS_FAULT_REASON_EXTERNAL_POWER
Charging fault due to external power source issue.
Definition bas.h:157
@ BT_BAS_BLS_FAULT_REASON_BATTERY
Charging fault due to battery issue.
Definition bas.h:154
@ BT_BAS_BLS_FAULT_REASON_OTHER
Charging fault for other reasons.
Definition bas.h:160
@ BT_BAS_BLS_FAULT_REASON_NONE
No charging fault.
Definition bas.h:151
@ BT_BAS_BLS_WIRELESS_POWER_CONNECTED
Wireless external power source is connected.
Definition bas.h:82
@ BT_BAS_BLS_WIRELESS_POWER_UNKNOWN
Wireless external power source status is unknown.
Definition bas.h:85
@ BT_BAS_BLS_WIRELESS_POWER_NOT_CONNECTED
Wireless external power source is not connected.
Definition bas.h:79
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
state
Definition parser_state.h:29
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Misc utilities.