src/utilities.js
function getFirmware (dataBuffer) {
  const regexPattern = /v\d.\d*.\d*/;
  const ret = dataBuffer.toString().match(regexPattern);
  if (ret) {
    const elems = ret[0].split('.');
    return {
      major: Number(elems[0][1]),
      minor: Number(elems[1]),
      patch: Number(elems[2]),
      raw: ret[0]
    };
  } else return ret;
}
function getFirmware (dataBuffer) {
  const regexPattern = /v\d.\d*.\d*/;
  const ret = dataBuffer.toString().match(regexPattern);
  if (ret) {
    const elems = ret[0].split('.');
    return {
      major: Number(elems[0][1]),
      minor: Number(elems[1]),
      patch: Number(elems[2]),
      raw: ret[0]
    };
  } else return ret;
}
function getFirmware ( dataBuffer ) { const regexPattern = / v\d.\d*.\d* / ; const ret = dataBuffer . toString ( ) . match ( regexPattern ) ; if ( ret ) { const elems = ret [ 0 ] . split ( '.' ) ; return { major : Number ( elems [ 0 ] [ 1 ] ) , minor : Number ( elems [ 1 ] ) , patch : Number ( elems [ 2 ] ) , raw : ret [ 0 ] } ; } else return ret ; }
Used to extract the major version from
@param dataBuffer
@return {*}
Used to extract the major version from