result

if

call

method_name

()

==

"getBatteryLevel"

int

battery_level

GetBatteryLevel

();

if

battery_level

!=

result

>

Success

battery_level

);

else

result

>

Error

"UNAVAILABLE"

"Battery level not available."

);

else

result

>

NotImplemented

();

});