Module: ModBus::Debug
- Included in:
- Client, Client::Slave, RTUServer, RTUViaTCPServer, TCPServer
- Defined in:
- lib/rmodbus/debug.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#raise_exception_on_mismatch ⇒ Object
Returns the value of attribute raise_exception_on_mismatch.
-
#read_retries ⇒ Object
Returns the value of attribute read_retries.
-
#read_retry_timeout ⇒ Object
Returns the value of attribute read_retry_timeout.
Instance Method Summary collapse
-
#log(msg) ⇒ Object
private
Put log message on standard output.
-
#logging_bytes(msg) ⇒ String
private
Convert string of byte to string for log.
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/rmodbus/debug.rb', line 5 def logger @logger end |
#raise_exception_on_mismatch ⇒ Object
Returns the value of attribute raise_exception_on_mismatch.
5 6 7 |
# File 'lib/rmodbus/debug.rb', line 5 def raise_exception_on_mismatch @raise_exception_on_mismatch end |
#read_retries ⇒ Object
Returns the value of attribute read_retries.
5 6 7 |
# File 'lib/rmodbus/debug.rb', line 5 def read_retries @read_retries end |
#read_retry_timeout ⇒ Object
Returns the value of attribute read_retry_timeout.
5 6 7 |
# File 'lib/rmodbus/debug.rb', line 5 def read_retry_timeout @read_retry_timeout end |
Instance Method Details
#log(msg) ⇒ Object (private)
Put log message on standard output
13 14 15 |
# File 'lib/rmodbus/debug.rb', line 13 def log(msg) logger&.debug(msg) end |
#logging_bytes(msg) ⇒ String (private)
Convert string of byte to string for log
22 23 24 |
# File 'lib/rmodbus/debug.rb', line 22 def logging_bytes(msg) msg.unpack("H*").first.gsub(/\X{2}/, "[\\0]") end |