This repository has been archived by the owner. It is now read-only.

libbattery should be used #1

Closed
pavelmachek opened this Issue Oct 18, 2017 · 11 comments

Comments

Projects
None yet
5 participants
@pavelmachek
Member

pavelmachek commented Oct 18, 2017

SDL code will not work in all cases on N900, and it does not provide features such as battery temperature and current voltage. So I started libbattery:

https://github.com/pavelmachek/libbattery

Eventually, it would be good to turn it into shared library, so that we have one copy of code on the system.

@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Oct 18, 2017

Member

Eventually, it would be good to turn it into shared library, so that we have one copy of code on the system.

That makes sense!

Does it make sense to you to put libbattery in this repo, too, until the we have a working version? Development might be faster that way.

Member

ollieparanoid commented Oct 18, 2017

Eventually, it would be good to turn it into shared library, so that we have one copy of code on the system.

That makes sense!

Does it make sense to you to put libbattery in this repo, too, until the we have a working version? Development might be faster that way.

@IanS5

This comment has been minimized.

Show comment
Hide comment
@IanS5

IanS5 Oct 20, 2017

Member

@pavelmachek just submitted a PR for having libbattery compile to a shared library. I've got a branch ready for charging_sdl that will compile with that instead of SDL_power :D

Member

IanS5 commented Oct 20, 2017

@pavelmachek just submitted a PR for having libbattery compile to a shared library. I've got a branch ready for charging_sdl that will compile with that instead of SDL_power :D

@z3ntu

This comment has been minimized.

Show comment
Hide comment
@z3ntu

z3ntu Oct 20, 2017

Member

In the end we probably will want to have libbattery as an optional runtime dependency, so the N900 can depend on libbattery and the rest of the devices don't. I think that would be the best solution.

Member

z3ntu commented Oct 20, 2017

In the end we probably will want to have libbattery as an optional runtime dependency, so the N900 can depend on libbattery and the rest of the devices don't. I think that would be the best solution.

@IanS5

This comment has been minimized.

Show comment
Hide comment
@IanS5

IanS5 Oct 20, 2017

Member

implementing that would actually be pretty easy I think. At the moment I have the libbattery battery_fill_info function running inside a timer callback, if charging-sdl used its own battery info struct, than we could just switch which callback is being used. Then everything in the main loop could stay exactly the same, and it would be trivial to add other battery info fetching methods.

Member

IanS5 commented Oct 20, 2017

implementing that would actually be pretty easy I think. At the moment I have the libbattery battery_fill_info function running inside a timer callback, if charging-sdl used its own battery info struct, than we could just switch which callback is being used. Then everything in the main loop could stay exactly the same, and it would be trivial to add other battery info fetching methods.

@pavelmachek

This comment has been minimized.

Show comment
Hide comment
@pavelmachek

pavelmachek Oct 20, 2017

Member
Member

pavelmachek commented Oct 20, 2017

@MartijnBraam

This comment has been minimized.

Show comment
Hide comment
@MartijnBraam

MartijnBraam Oct 20, 2017

Member

Isn't the point of libbattery that you put the device specific stuff in the library so you don't have to do that in all the applications?

Member

MartijnBraam commented Oct 20, 2017

Isn't the point of libbattery that you put the device specific stuff in the library so you don't have to do that in all the applications?

@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Oct 20, 2017

Member

In general, I would also prefer having less possible code paths, so using libbattery for everything would be cool with me. It will be a super lightweight library anyway.

With that being said, I consider this to be a detail and don't have a strong opinion on it, as long as we make it work 👍

@pavelmachek: I recommend, that you "watch" the repositories you are actively working on, i.e. libbattery, so you get notified of pull-requests and issues (unless you already have another workflow for that, then ignore this comment).

Member

ollieparanoid commented Oct 20, 2017

In general, I would also prefer having less possible code paths, so using libbattery for everything would be cool with me. It will be a super lightweight library anyway.

With that being said, I consider this to be a detail and don't have a strong opinion on it, as long as we make it work 👍

@pavelmachek: I recommend, that you "watch" the repositories you are actively working on, i.e. libbattery, so you get notified of pull-requests and issues (unless you already have another workflow for that, then ignore this comment).

@IanS5

This comment has been minimized.

Show comment
Hide comment
@IanS5

IanS5 Oct 20, 2017

Member

For now why don't we just give the option to use either one, because libbattery is so new it may not cover some devices SDL does, and SDL (obviously) doesn't support at least one device libbattery does. Once both charging-sdl and libbattery mature a bit we could switch to just libbattery

implemented this idea with a make variable: #2

Member

IanS5 commented Oct 20, 2017

For now why don't we just give the option to use either one, because libbattery is so new it may not cover some devices SDL does, and SDL (obviously) doesn't support at least one device libbattery does. Once both charging-sdl and libbattery mature a bit we could switch to just libbattery

implemented this idea with a make variable: #2

@pavelmachek

This comment has been minimized.

Show comment
Hide comment
@pavelmachek

pavelmachek Oct 21, 2017

Member
Member

pavelmachek commented Oct 21, 2017

@IanS5

This comment has been minimized.

Show comment
Hide comment
@IanS5

IanS5 Oct 29, 2017

Member

@ollieparanoid sorry this is completely the wrong place for this... but could I get write access on this repo?

Member

IanS5 commented Oct 29, 2017

@ollieparanoid sorry this is completely the wrong place for this... but could I get write access on this repo?

@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Oct 29, 2017

Member

Sure, in fact I already gave it to you, but you need to click this link (I guess it should have been sent via mail).

Member

ollieparanoid commented Oct 29, 2017

Sure, in fact I already gave it to you, but you need to click this link (I guess it should have been sent via mail).

@IanS5 IanS5 closed this Nov 3, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.