get_battery_level

()

// Find the first available battery and report that.

g_autoptr

UpClient

up_client

up_client_new

();

g_autoptr

GPtrArray

devices

up_client_get_devices2

up_client

);

if

devices

>

len

==

return

FL_METHOD_RESPONSE

fl_method_error_response_new

"UNAVAILABLE"

"Device does not have a battery."

nullptr

));

UpDevice

device

UpDevice