UNPKG

bt-seneca-msc

Version:

A pure Javascript API for the Seneca Multi Smart Calibrator (MSC) device, using web bluetooth.

23 lines (19 loc) 544 B
var constants = require("../constants"); /** * Current state of the meter * */ class MeterState { constructor() { this.firmware = ""; // Firmware version this.serial = ""; // Serial number this.mode = constants.CommandType.NONE_UNKNOWN; this.battery = 0.0; } isMeasurement() { return this.mode > constants.CommandType.NONE_UNKNOWN && this.mode < constants.CommandType.OFF; } isGeneration() { return this.mode > constants.CommandType.OFF && this.mode < constants.CommandType.GEN_RESERVED; } } module.exports = MeterState;