-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Dasharo/protectli-vp66X0
Protectli vp66 x0
- Loading branch information
Showing
6 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ flash_chip: | |
voltage: "1.8V" | ||
|
||
programmer: | ||
name: rte | ||
name: rte_1_1 | ||
|
||
pwr_ctrl: | ||
sonoff: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
flash_chip: | ||
model: "MX25L12833F/MX25L12835F/MX25L12845E/MX25L12865E/MX25L12873F" | ||
voltage: "3.3V" | ||
|
||
programmer: | ||
name: rte_1_1 | ||
|
||
pwr_ctrl: | ||
sonoff: true | ||
relay: false | ||
init_on: true | ||
|
||
reset_cmos: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
flash_chip: | ||
model: "MX25L12833F/MX25L12835F/MX25L12845E/MX25L12865E/MX25L12873F" | ||
voltage: "3.3V" | ||
|
||
programmer: | ||
name: rte_1_1 | ||
|
||
pwr_ctrl: | ||
sonoff: true | ||
relay: false | ||
init_on: true | ||
|
||
reset_cmos: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import robot.api.logger | ||
from rte import RTE | ||
from snipeit_api import SnipeIT | ||
|
||
|
||
class RobotRTE: | ||
def __init__(self, rte_ip): | ||
snipeit_api = SnipeIT() | ||
asset_id = snipeit_api.get_asset_id_by_rte_ip(rte_ip) | ||
status, dut_model_name = snipeit_api.get_asset_model_name(asset_id) | ||
if status: | ||
robot.api.logger.info(f"DUT model retrieved from snipeit: {dut_model_name}") | ||
else: | ||
raise AssertionError( | ||
f"Failed to retrieve model name from Snipe-IT. Check again arguments, or try providing model manually." | ||
) | ||
self.rte = RTE(rte_ip, dut_model_name, snipeit_api) | ||
|
||
def flash_read(self, fw_file): | ||
robot.api.logger.info(f"Reading from flash...") | ||
self.rte.flash_read(fw_file) | ||
robot.api.logger.info(f"Read flash content saved to {fw_file}") | ||
|
||
def flash_write(self, fw_file): | ||
robot.api.logger.info(f"Writing {fw_file} to flash...") | ||
self.rte.flash_write(fw_file) | ||
robot.api.logger.info(f"Flash written") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters