Hi Jerzy,

Thanks for your reply.
1. I agree it is not vital, as I was able to replace it with a different call ;-) Do you prefer to implement it or shall I send a pull request to remove the function declaration? 2. How could we make that easier? I think the Battery Manager is a really great abstraction. It allows to write generic code that works on multiple boards. However you need to do a board specific thing to start using it. I don't have enough experiance with mynewt to see how this could be made better. 3. OK, I plan to write a documenation page about the Battery API, but the Battery Manager is not that useful currently.

Thanks,
Casper

Op zondag 19 april 2020 om 19u33 schreef Jerzy Kasenberg <[email protected]>:
Hi Casper,

1. I must have thought this function would be consistent with other APIs
(probably charger or sensors).
Then since there would probably be only one battery reading device finding
it by name did not seem
vital and I simply forgot to do it.
2. There is no logic in OS to use battery yet so an application has to open
the device and do whatever needs to be done.
3. I'm afraid there is not.

br
Jerzy


sob., 18 kwi 2020 o 15:11 Casper Meijn <[email protected] <mailto:[email protected]>> napisaƂ(a):

 Hi all,

I have some questions about how to use the Battery Manager API. I want to write application code that is independent from the hardware. So my
 first try to retrieve the battery os_dev was using the
`battery_mgr_find_by_name` function. However this function doesn't have
 a implementation. My second try was using `battery_get_battery`
 function, which returns the battery as expected, however it was not
 initialized. I got it working using `os_dev_open("battery" ...)`,
 however now I am dependant on the device name. So my questions are:

 - Why is `battery_mgr_find_by_name` not implemented?
 - Who is supposed to do `os_dev_open("battery" ...)`? Is that the
 application, the BSP or something else?
 - Are there examples of the usage of Battery Manager API?

 Thanks in advance,
 Casper



Reply via email to