Sample Javascript to access EB.Battery.smartBatteryStatus api

D Dino Gregorich 3 years 5 months ago
13 1 0

The api for "smartBatteryStatus" is differently used than the "batteryStatus" api.  The sample code only demonstrates how to access the EB.Battery.batteryStatus, but not the smartBatteryStatus.  I need to see a sample on how to use the api so that I can access the battery identification information to create the unique Battery ID (BID).  Any code snippet would be appreciated.

Please Register or Login to post a reply

1 Replies

E Efkan YILMAZ

Hi, the following should work:
EB.Battery.smartBatteryStatus(batteryCallback);
function batteryCallback(params){
if(params){ // Most of these methods have callbacks but null 'params' sent.
console.log(params);
}
else
console.log("No Params");
}
I do not have a device handy to double-check however.

CONTACT
Can’t find what you’re looking for?