Skip to content

Commit

Permalink
Display info about product firmware in binary inspect command
Browse files Browse the repository at this point in the history
  • Loading branch information
monkbroc committed Jan 31, 2020
1 parent abc6c7a commit 2616f6d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cmd/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ class BinaryCommand {
+ ' at version '
+ chalk.bold(fileInfo.prefixInfo.moduleVersion.toString()));

if (fileInfo.suffixInfo.productId !== 65535 && fileInfo.suffixInfo.productVersion !== 65535) {
console.log(' It is firmware for '
+ chalk.bold('product id ' + fileInfo.suffixInfo.productId)
+ ' at version '
+ chalk.bold(fileInfo.suffixInfo.productVersion));
}

if (fileInfo.prefixInfo.depModuleFunction){
console.log(' It depends on '
+ chalk.bold(functions[fileInfo.prefixInfo.depModuleFunction])
Expand Down
Binary file added test/__fixtures__/binaries/product_firmware.bin
Binary file not shown.
11 changes: 11 additions & 0 deletions test/e2e/binary.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ describe('Binary Commands', () => {
' This is an application module number 1 at version 6',
' It depends on a system module number 1 at version 1213'
]
},
{
file: 'product_firmware.bin',
contents: [
'product_firmware.bin',
' CRC is ok (e309c618)',
' Compiled for electron',
' This is an application module number 1 at version 6',
' It is firmware for product id 8178 at version 13',
' It depends on a system module number 2 at version 1201'
]
}
];

Expand Down

0 comments on commit 2616f6d

Please sign in to comment.