function toDuration(byte) {
  var data = parseInt(byte,16);
  if(data < 64) { // Less than 0x40 is seconds
    return data;
  }
  if(data >= 128) { // Above 0x80 is hours
    return (data % 128) * 3600;
  }
  return (data % 64) * 60; // Between the two is minutes
}
/**
 * Convert the given twos complement hexadecimal string to duration.
 * @param {String} byte The duration data byte as a string.
 */
Convert the given twos complement hexadecimal string to duration.
@param {String} byte The duration data byte as a string.
Convert the given twos complement hexadecimal string to duration . @param { String } byte The duration data byte as a string .
function toDuration(byte) {
  var data = parseInt(byte,16);
  if(data < 64) { 
    return data;
  }
  if(data >= 128) { 
    return (data % 128) * 3600;
  }
  return (data % 64) * 60; 
}
function toDuration ( byte ) { var data = parseInt ( byte , 16 ) ; if ( data < 64 ) { return data ; } if ( data >= 128 ) { return ( data % 128 ) * 3600 ; } return ( data % 64 ) * 60 ; }
Convert the given twos complement hexadecimal string to duration.
Convert the given twos complement hexadecimal string to duration .
// Less than 0x40 is seconds // Above 0x80 is hours // Between the two is minutes