lsm_battery_list(3)

πŸ“¦
version 1.10.3 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– lsm_battery_list(3) β€” the Libstoragemgmt C API Manual, bestie edition ✨

okay so bestie, pull up a chair, we're getting a list of batteries πŸ”‹ and honestly? iconic behaviour. this is lsm_battery_list from the Libstoragemgmt C API, and yes she's a whole queen. no cap.


🌸 NAME 🌸

lsm_battery_list β€” gets a list of batteries on this connection. that's it, that's the job, and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

int lsm_battery_list (lsm_connect *conn, const char *search_key, const
char *search_value, lsm_battery **bs[], uint32_t *count, lsm_flag
flags);

look at her. six arguments. main character energy fr fr 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • conn β€” a valid lsm_connect pointer. like, an actually valid one. she's not doing charity work for a NULL, sorry babe 😭
  • search_key β€” the search key. pass NULL if you want everything (yes, everything, we love a generous moment πŸ’–). the valid search keys are: "id" and "system_id". those two, periodt.
  • search_value β€” the search value. the matching half of the search key situation, iykyk.
  • bs[] β€” output pointer of an lsm_battery array. and listen, listen: the returned value must be freed by calling lsm_battery_record_array_free. no leaking, bestie, that's not the vibe πŸš«πŸ’€
  • count β€” output pointer of uint32_t. number of batteries. she'll tell you how many she found πŸ’…
  • flags β€” reserved for future use, so you must pass LSM_CLIENT_FLAG_RSVD. not a suggestion, that's the rule πŸ“

🌈 VERSION 🌈

1.3.


πŸ¦‹ DESCRIPTION πŸ¦‹

Gets a list of batteries on this connection. and here's the fun part β€” when present, super capacitors will also be included. surprise! extra credit! we love a bonus βš‘πŸ“

you can grab all the battery properties using these little cuties:

  • lsm_battery_id_get
  • lsm_battery_name_get
  • lsm_battery_system_id_get
  • lsm_battery_type_get
  • lsm_battery_status_get

five functions, all obsessed with getting you the details. go off, besties πŸ‘‘


πŸ‘‘ CAPABILITY πŸ‘‘

LSM_CAP_BATTERIES

that's the one you need. check it, love it, respect it 🌟


πŸ’œ RETURN πŸ’œ

Error code as enumerated by lsm_error_number. here's the rundown:

  • LSM_ERR_OK β€” on success or when the searched value isn't found. yes, "not found" still counts as OK around here, she's chill like that 😌
  • LSM_ERR_INVALID_ARGUMENT β€” when any argument is NULL, or the flags are invalid, or the search key is invalid. basically if you're being messy, she's gonna tell you πŸ’€
  • LSM_ERR_NO_SUPPORT β€” not supported. she simply cannot, will not, and is not about to πŸ™ˆ

fr fr reminder: free that array with lsm_battery_record_array_free. your future self will thank you 🫢✨

okay that's the whole page, you ate, go be a main character with your battery list πŸŒΈπŸ’…πŸŽ€

later bestie, mwah πŸ’– β€” this was lsm_battery_list(3) from the Libstoragemgmt C API Manual, source version 1.3., dated February 2026 β­πŸŒˆπŸ¦‹

πŸ“¦ where this page comes from