Zephyr API Documentation 4.0.0-rc3
A Scalable Open Source RTOS
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
42
59
71
86
101
119
137
158
176
191
203
211
222
229
236
243
250
257
264
271
280
289
298
299#ifdef __cplusplus
300}
301#endif
302
307#endif /* ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_BAS_H_ */
bt_bas_bls_battery_present
Battery Present Status.
Definition bas.h:64
bt_bas_bls_battery_charge_state
Battery Charge State.
Definition bas.h:106
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:76
bt_bas_bcs_flags
Battery Critical Status Characteristic flags.
Definition bas.h:35
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:196
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:49
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:142
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:124
bt_bas_bls_service_required
Service Required Status.
Definition bas.h:181
bt_bas_bls_charging_fault_reason
Charging Fault Reason.
Definition bas.h:163
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:91
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:69
@ BT_BAS_BLS_BATTERY_NOT_PRESENT
Battery is not present.
Definition bas.h:66
@ BT_BAS_BLS_CHARGE_STATE_DISCHARGING_INACTIVE
Battery is discharging but inactive.
Definition bas.h:117
@ BT_BAS_BLS_CHARGE_STATE_CHARGING
Battery is currently charging.
Definition bas.h:111
@ BT_BAS_BLS_CHARGE_STATE_UNKNOWN
Battery charge state is unknown.
Definition bas.h:108
@ BT_BAS_BLS_CHARGE_STATE_DISCHARGING_ACTIVE
Battery is discharging actively.
Definition bas.h:114
@ BT_BAS_BLS_WIRED_POWER_UNKNOWN
Wired external power source status is unknown.
Definition bas.h:84
@ BT_BAS_BLS_WIRED_POWER_NOT_CONNECTED
Wired external power source is not connected.
Definition bas.h:78
@ BT_BAS_BLS_WIRED_POWER_CONNECTED
Wired external power source is connected.
Definition bas.h:81
@ BT_BAS_BCS_BATTERY_CRITICAL_STATE
Battery Critical Status Bit 0: Critical Power State.
Definition bas.h:37
@ BT_BAS_BCS_IMMEDIATE_SERVICE_REQUIRED
Battery Critical Status Bit 1: Immediate Service Required.
Definition bas.h:40
@ BT_BAS_BLS_BATTERY_FAULT_YES
Battery fault present.
Definition bas.h:201
@ BT_BAS_BLS_BATTERY_FAULT_NO
No battery fault.
Definition bas.h:198
@ BT_BAS_BLS_FLAG_IDENTIFIER_PRESENT
Bit indicating that the Battery Level Status identifier is present.
Definition bas.h:51
@ BT_BAS_BLS_FLAG_BATTERY_LEVEL_PRESENT
Bit indicating that the Battery Level is present.
Definition bas.h:54
@ BT_BAS_BLS_FLAG_ADDITIONAL_STATUS_PRESENT
Bit indicating that additional status information is present.
Definition bas.h:57
@ BT_BAS_BLS_CHARGE_TYPE_UNKNOWN
Battery charge type is unknown or not charging.
Definition bas.h:144
@ BT_BAS_BLS_CHARGE_TYPE_CONSTANT_CURRENT
Battery is charged using constant current.
Definition bas.h:147
@ BT_BAS_BLS_CHARGE_TYPE_CONSTANT_VOLTAGE
Battery is charged using constant voltage.
Definition bas.h:150
@ BT_BAS_BLS_CHARGE_TYPE_FLOAT
Battery is charged using float charge.
Definition bas.h:156
@ BT_BAS_BLS_CHARGE_TYPE_TRICKLE
Battery is charged using trickle charge.
Definition bas.h:153
@ BT_BAS_BLS_CHARGE_LEVEL_LOW
Battery charge level is low.
Definition bas.h:132
@ BT_BAS_BLS_CHARGE_LEVEL_CRITICAL
Battery charge level is critical.
Definition bas.h:135
@ BT_BAS_BLS_CHARGE_LEVEL_UNKNOWN
Battery charge level is unknown.
Definition bas.h:126
@ BT_BAS_BLS_CHARGE_LEVEL_GOOD
Battery charge level is good.
Definition bas.h:129
@ BT_BAS_BLS_SERVICE_REQUIRED_TRUE
Service is required.
Definition bas.h:186
@ BT_BAS_BLS_SERVICE_REQUIRED_FALSE
Service is not required.
Definition bas.h:183
@ BT_BAS_BLS_SERVICE_REQUIRED_UNKNOWN
Service requirement is unknown.
Definition bas.h:189
@ BT_BAS_BLS_FAULT_REASON_EXTERNAL_POWER
Charging fault due to external power source issue.
Definition bas.h:171
@ BT_BAS_BLS_FAULT_REASON_BATTERY
Charging fault due to battery issue.
Definition bas.h:168
@ BT_BAS_BLS_FAULT_REASON_OTHER
Charging fault for other reasons.
Definition bas.h:174
@ BT_BAS_BLS_FAULT_REASON_NONE
No charging fault.
Definition bas.h:165
@ BT_BAS_BLS_WIRELESS_POWER_CONNECTED
Wireless external power source is connected.
Definition bas.h:96
@ BT_BAS_BLS_WIRELESS_POWER_UNKNOWN
Wireless external power source status is unknown.
Definition bas.h:99
@ BT_BAS_BLS_WIRELESS_POWER_NOT_CONNECTED
Wireless external power source is not connected.
Definition bas.h:93
#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.