Sample Javascript to access EB.Battery.smartBatteryStatus api

D Dino Gregorich 2 years 10 months ago
6 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

V Vedsatx Saddvv

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?