Lines Matching refs:bls
16 static struct bt_bas_bls bls; variable
73 bls.flags = 0; in bt_bas_bls_init()
74 bls.power_state = 0; in bt_bas_bls_init()
78 bls.flags |= BT_BAS_BLS_FLAG_IDENTIFIER_PRESENT; in bt_bas_bls_init()
79 bls.identifier = 0; in bt_bas_bls_init()
84 bls.flags |= BT_BAS_BLS_FLAG_BATTERY_LEVEL_PRESENT; in bt_bas_bls_init()
85 bls.battery_level = bt_bas_get_battery_level(); in bt_bas_bls_init()
90 bls.flags |= BT_BAS_BLS_FLAG_ADDITIONAL_STATUS_PRESENT; in bt_bas_bls_init()
91 bls.additional_status = 0; in bt_bas_bls_init()
111 .flags = bls.flags, in bt_bas_bls_update_battery_level_status()
112 .power_state = sys_cpu_to_le16(bls.power_state), in bt_bas_bls_update_battery_level_status()
114 .identifier = sys_cpu_to_le16(bls.identifier), in bt_bas_bls_update_battery_level_status()
117 .battery_level = bls.battery_level, in bt_bas_bls_update_battery_level_status()
120 .additional_status = bls.additional_status, in bt_bas_bls_update_battery_level_status()
147 .flags = bls.flags, in bt_bas_bls_read_blvl_status()
148 .power_state = sys_cpu_to_le16(bls.power_state), in bt_bas_bls_read_blvl_status()
150 .identifier = sys_cpu_to_le16(bls.identifier), in bt_bas_bls_read_blvl_status()
153 .battery_level = bls.battery_level, in bt_bas_bls_read_blvl_status()
156 .additional_status = bls.additional_status, in bt_bas_bls_read_blvl_status()
166 bls.power_state &= ~BATTERY_MASK; in bt_bas_bls_set_battery_present()
167 bls.power_state |= (present << BATTERY_SHIFT) & BATTERY_MASK; in bt_bas_bls_set_battery_present()
173 bls.power_state &= ~WIRED_POWER_MASK; in bt_bas_bls_set_wired_external_power_source()
174 bls.power_state |= (source << WIRED_POWER_SHIFT) & WIRED_POWER_MASK; in bt_bas_bls_set_wired_external_power_source()
180 bls.power_state &= ~WIRELESS_POWER_MASK; in bt_bas_bls_set_wireless_external_power_source()
181 bls.power_state |= (source << WIRELESS_POWER_SHIFT) & WIRELESS_POWER_MASK; in bt_bas_bls_set_wireless_external_power_source()
187 bls.power_state &= ~BATTERY_CHARGE_STATE_MASK; in bt_bas_bls_set_battery_charge_state()
188 bls.power_state |= (state << BATTERY_CHARGE_STATE_SHIFT) & BATTERY_CHARGE_STATE_MASK; in bt_bas_bls_set_battery_charge_state()
194 bls.power_state &= ~BATTERY_CHARGE_LEVEL_MASK; in bt_bas_bls_set_battery_charge_level()
195 bls.power_state |= (level << BATTERY_CHARGE_LEVEL_SHIFT) & BATTERY_CHARGE_LEVEL_MASK; in bt_bas_bls_set_battery_charge_level()
215 bls.power_state &= ~BATTERY_CHARGE_TYPE_MASK; in bt_bas_bls_set_battery_charge_type()
216 bls.power_state |= (type << BATTERY_CHARGE_TYPE_SHIFT) & BATTERY_CHARGE_TYPE_MASK; in bt_bas_bls_set_battery_charge_type()
222 bls.power_state &= ~CHARGING_FAULT_MASK; in bt_bas_bls_set_charging_fault_reason()
223 bls.power_state |= (reason << CHARGING_FAULT_SHIFT) & CHARGING_FAULT_MASK; in bt_bas_bls_set_charging_fault_reason()
230 bls.battery_level = level; in bt_bas_bls_set_battery_level()
238 bls.identifier = sys_cpu_to_le16(identifier); in bt_bas_bls_set_identifier()
246 bls.additional_status &= ~SERVICE_REQUIRED_MASK; in bt_bas_bls_set_service_required()
247 bls.additional_status |= (value << SERVICE_REQUIRED_SHIFT) & SERVICE_REQUIRED_MASK; in bt_bas_bls_set_service_required()
267 bls.additional_status &= ~BATTERY_FAULT_MASK; in bt_bas_bls_set_battery_fault()
268 bls.additional_status |= (value << BATTERY_FAULT_SHIFT) & BATTERY_FAULT_MASK; in bt_bas_bls_set_battery_fault()