Skip to content

Commit

Permalink
verify firmware 0.0.4 with new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsmith540 committed Sep 23, 2020
1 parent 9bdce1a commit 67e9cb4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions miner/GoldShell_Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,34 @@ class GoldShellAsic{
position += 1;
const fwVersion = data.slice(position,position+fwLen).toString('utf8');
position += fwLen;

let fwVersionInt = fwVersion.split('.');
fwVersionInt = fwVersionInt.pop();
if(fwVersionInt.length > 0){
fwVersionInt = parseInt(fwVersionInt);
}

if(isHS1Plus){
position += 3; //whitespace at start of serial for hs1 plus..
}
else{
//hs1
position += 3;
}
let pNext = isHS1Plus ? position + 18 : position + 32;
let pNext = isHS1Plus ? position + 18 : position + (fwVersionInt >= 4 ? 18 : 32);
const serial = data.slice(position,pNext).toString('utf8');
const hashRate = data.slice(position, position+32);
let wdPosition = 99;
if(isHS1Plus){
wdPosition = 54+3;
}
if(!isHS1Plus && (fwVersion.indexOf('0.0.4') >= 0 || fwVersion.indexOf('0.0.5') >= 0)){
//hs1 with firmware 0.0.4
wdPosition = 51+3;

if(!isHS1Plus && (fwVersionInt >= 4)){
//hs1 with firmware 0.0.4+
wdPosition = 50+3;
}
let workDepth = data[wdPosition];//data[99];
if(typeof workDepth == "undefined" || workDepth == 0){
if(typeof workDepth == "undefined" || workDepth == 0 || workDepth > 8){
//in case future firmware changes workDepth location again
if(isHS1Plus){
workDepth = 8;
Expand Down

0 comments on commit 67e9cb4

Please sign in to comment.