Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
address = self.channel.get_apps_start_address()
# Jump through the linked list of apps
while (True):
header_length = 200 # Version 2
flash = self.channel.read_range(address, header_length)
# if there was an error, the binary array will be empty
if len(flash) < header_length:
break
# Get all the fields from the header
tbfh = TBFHeader(flash)
if tbfh.is_valid():
app = InstalledApp(tbfh, address)
apps.append(app)
address += app.get_size()
else:
break
if self.args.debug:
logging.debug('Found {} app{} on the board.'.format(len(apps), helpers.plural(len(apps))))
for i,app in enumerate(apps):
logging.debug(' {}. {}'.format(i+1, app))
return apps