class ADAM6050::Handler::Status

Allows registed senders to read the IO status.

I have so far not been able to find any documentation around this feature. The meaning of the rely is therefore currently unknown.

Constants

MESSAGE_PREAMBLE

@return [String] see Handler::MESSAGE_PREAMBLE.

Public Instance Methods

handle(msg, state, *) click to toggle source

@param msg [String] the incomming message. @param state [Integer] the current state. @return [Integer] the next state (always unchanged). @return [String] the reply.

# File lib/adam6050/handler/status.rb, line 19
def handle(msg, state, *)
  reply =
    if msg == MESSAGE_PREAMBLE + "\r"
      '!01' + '000000000000' + '000000000000' + '000000000000'
    else
      '>'
    end

  [state, reply]
end