Class: LXP::Packet::WriteSingle
- Defined in:
- lib/lxp/packet/write_single.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #discharge_cut_off=(value) ⇒ Object
- #discharge_rate=(value) ⇒ Object
-
#initialize ⇒ WriteSingle
constructor
A new instance of WriteSingle.
-
#value ⇒ Object
WriteSingle packets should always (I think) have two byte values.
Methods inherited from Base
#bytes, #data_length, #data_length=, #datalog_serial, #datalog_serial=, #device_function, #device_function=, #inverter_serial, #inverter_serial=, #packet_length, #packet_length=, parse, #protocol, #protocol=, #register, #register=, #tcp_function, #tcp_function=, #to_bin, #update_checksum, #value=, #value_length, #values
Constructor Details
#initialize ⇒ WriteSingle
Returns a new instance of WriteSingle.
8 9 10 11 12 13 14 |
# File 'lib/lxp/packet/write_single.rb', line 8 def initialize super self.tcp_function = TcpFunctions::TRANSLATED_DATA self.device_function = DeviceFunctions::WRITE_SINGLE self.data_length = 18 end |
Instance Method Details
#discharge_cut_off=(value) ⇒ Object
21 22 23 24 |
# File 'lib/lxp/packet/write_single.rb', line 21 def discharge_cut_off=(value) self.register = Registers::DISCHG_CUT_OFF_SOC_EOD self.value = value end |
#discharge_rate=(value) ⇒ Object
16 17 18 19 |
# File 'lib/lxp/packet/write_single.rb', line 16 def discharge_rate=(value) self.register = Registers::DISCHG_POWER_PERCENT_CMD self.value = value end |