Class: Prremote::Commands::Undeploy
- Inherits:
-
Object
- Object
- Prremote::Commands::Undeploy
- Defined in:
- lib/prremote/commands/undeploy.rb
Constant Summary collapse
- ERASE_MAGIC =
'ERSE'.freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(port:, baud:) ⇒ Undeploy
constructor
A new instance of Undeploy.
Constructor Details
#initialize(port:, baud:) ⇒ Undeploy
Returns a new instance of Undeploy.
6 7 8 9 |
# File 'lib/prremote/commands/undeploy.rb', line 6 def initialize(port:, baud:) @port = port @baud = baud end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/prremote/commands/undeploy.rb', line 11 def call serial = Serial.new(@port, @baud) sleep 0.5 serial.read(4096) serial.write(ERASE_MAGIC) wait_for_erased(serial) warn 'Flash erased. Device will no longer auto-run a script on boot.' ensure serial&.close end |