mirror of
https://github.com/dekuNukem/USB4VC.git
synced 2025-10-31 11:26:46 -07:00
added firmware list get
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
print(fw_list[0].split('_V')[1].split('.')[0].replace('_', '.'))
|
||||
fw_list.append('PBFW_IBMPC_PBID1_V0_1_6.hex')
|
||||
fw_list.append('PBFW_IBMPC_PBID1_V0_1_1.hex')
|
||||
fw_list.append('PBFW_IBMPC_PBID1_V0_0_3.hex')
|
||||
fw_list.append('PBFW_IBMPC_PBID1_V1_0_3.hex')
|
||||
|
||||
-----------
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
scp ./* pi@169.254.194.124:~/usb4vc/rpi_app
|
||||
# ssh -t pi@169.254.194.124 "pkill python3;cd ~/usb4vc/rpi_app;python3 usb4vc_main.py"
|
||||
# ssh -t pi@169.254.194.124 "pkill python3;cd ~/usb4vc/rpi_app;python3 usb4vc_check_update.py"
|
||||
ssh -t pi@169.254.194.124 "pkill python3;cd ~/usb4vc/rpi_app;python3 usb4vc_check_update.py"
|
||||
|
||||
# ssh -t pi@169.254.194.124 "pkill python3;cd ~/usb4vc/rpi_app;python3 firmware_flasher.py /home/pi/usb4vc/firmware/PBFW_IBMPC_PBID1_V0_1_5.hex"
|
||||
# ssh -t pi@169.254.194.124 "pkill python3;cd ~/usb4vc/rpi_app;python3 bb_tester.py"
|
||||
@@ -95,6 +95,23 @@ def update(temp_path):
|
||||
os.system(f'cp -fv {os.path.join(src_code_path, "*")} {this_app_dir_path}')
|
||||
return 0, 'Success'
|
||||
|
||||
firmware_url = 'https://api.github.com/repos/dekuNukem/USB4VC/contents/firmware/releases?ref=master'
|
||||
|
||||
# version number most recent to least recent
|
||||
# dont for get to check extension
|
||||
def get_firmware_list(pcard_id):
|
||||
try:
|
||||
file_list = json.loads(urllib.request.urlopen(firmware_url).read())
|
||||
fw_list = [x['name'] for x in file_list if 'name' in x and 'type' in x and x['type'] == 'file']
|
||||
fw_list = [d for d in fw_list if d.startswith('PBFW') and d.lower() and f"PBID{pcard_id}" in d]
|
||||
fw_list.sort(key=lambda s: list(map(int, s.lower().split('_v')[1].split('.')[0].replace('_', '.').split('.'))), reverse=True)
|
||||
except Exception as e:
|
||||
print('get_firmware_list:', e)
|
||||
return []
|
||||
return fw_list
|
||||
|
||||
print(get_firmware_list(1))
|
||||
|
||||
# print(update(temp_dir_path))
|
||||
# print(get_usb4vc_update(temp_dir_path))
|
||||
# print(get_remote_tag_version() >= RPI_APP_VERSION_TUPLE)
|
||||
|
||||
Reference in New Issue
Block a user