function interpretBlueUpSafety(deviceIdElements, interpretedPacket) {
  if(deviceIdElements.length === 3) {
    let batteryVoltage = (parseInt(deviceIdElements[2].substring(0,2), 16) /
                          100) + 1.7;
    let triggerFlags = deviceIdElements[2].substring(2,4);
    let isButtonPressed = [ Boolean(triggerFlags & 0x01),
                            Boolean(triggerFlags & 0x02) ];
    // TODO: include motion detection and man down flags?

    interpretedPacket.batteryVoltage = batteryVoltage;
    interpretedPacket.isButtonPressed = isButtonPressed;
  }
}
/**
 * Interpret the BlueUp Safety data (embedded in iBeacon major/minor).
 * @param {Array} deviceIdElements The elements of the device identifier.
 * @param {Object} interpretedPacket The partially-interpreted packet.
 */
Interpret the BlueUp Safety data (embedded in iBeacon major/minor).
@param {Array} deviceIdElements The elements of the device identifier.
@param {Object} interpretedPacket The partially-interpreted packet.
Interpret the BlueUp Safety data ( embedded in iBeacon major / minor ) . @param { Array } deviceIdElements The elements of the device identifier . @param { Object } interpretedPacket The partially - interpreted packet .
function interpretBlueUpSafety(deviceIdElements, interpretedPacket) {
  if(deviceIdElements.length === 3) {
    let batteryVoltage = (parseInt(deviceIdElements[2].substring(0,2), 16) /
                          100) + 1.7;
    let triggerFlags = deviceIdElements[2].substring(2,4);
    let isButtonPressed = [ Boolean(triggerFlags & 0x01),
                            Boolean(triggerFlags & 0x02) ];
    interpretedPacket.batteryVoltage = batteryVoltage;
    interpretedPacket.isButtonPressed = isButtonPressed;
  }
}
function interpretBlueUpSafety ( deviceIdElements , interpretedPacket ) { if ( deviceIdElements . length === 3 ) { let batteryVoltage = ( parseInt ( deviceIdElements [ 2 ] . substring ( 0 , 2 ) , 16 ) / 100 ) + 1.7 ; let triggerFlags = deviceIdElements [ 2 ] . substring ( 2 , 4 ) ; let isButtonPressed = [ Boolean ( triggerFlags & 0x01 ) , Boolean ( triggerFlags & 0x02 ) ] ; interpretedPacket . batteryVoltage = batteryVoltage ; interpretedPacket . isButtonPressed = isButtonPressed ; } }
Interpret the BlueUp Safety data (embedded in iBeacon major/minor).
Interpret the BlueUp Safety data ( embedded in iBeacon major / minor ) .
// TODO: include motion detection and man down flags?