Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Minor function renaming for style consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdewald committed Feb 12, 2022
1 parent 260a43e commit fb1e968
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.1] - 2022-02-13

### Changed
- Minor renaming of function for style consistency.

## [0.2.0] - 2022-02-12

### Added
Expand Down
2 changes: 1 addition & 1 deletion include/simplebluez/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Device : public SimpleDBus::Proxy {

// ----- BATTERY INTERFACE -----
bool has_battery_interface();
uint8_t read_battery_percentage();
uint8_t battery_percentage();
void set_on_battery_percentage_changed(std::function<void(uint8_t new_value)> callback);
void clear_on_battery_percentage_changed();

Expand Down
2 changes: 1 addition & 1 deletion src/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void Device::clear_on_services_resolved() { device1()->OnServicesResolved.unload

bool Device::has_battery_interface() { return interface_exists("org.bluez.Battery1"); }

uint8_t Device::read_battery_percentage() { return battery1()->Percentage(); }
uint8_t Device::battery_percentage() { return battery1()->Percentage(); }

void Device::set_on_battery_percentage_changed(std::function<void(uint8_t new_value)> callback) {
battery1()->OnPercentageChanged.load([this, callback]() { callback(battery1()->Percentage()); });
Expand Down

0 comments on commit fb1e968

Please sign in to comment.