Class: Samsung::Protocol::Response
- Defined in:
- lib/samsung/protocol/response.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#code ⇒ Object
Returns the value of attribute code.
-
#response_frame ⇒ Object
Returns the value of attribute response_frame.
Attributes inherited from Frame
Instance Method Summary collapse
-
#initialize(data) ⇒ Response
constructor
A new instance of Response.
- #response_type ⇒ Object
Methods inherited from Frame
#hex, #pop_frame, #pop_int16, #pop_int32, #pop_int8, #pop_string, #pop_string64, #push_frame, #push_int16, #push_int32, #push_int8, #push_string, #push_string64, #size
Constructor Details
#initialize(data) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/samsung/protocol/response.rb', line 6 def initialize data @data = data parse_response end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
4 5 6 |
# File 'lib/samsung/protocol/response.rb', line 4 def app_name @app_name end |
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/samsung/protocol/response.rb', line 4 def code @code end |
#response_frame ⇒ Object
Returns the value of attribute response_frame.
4 5 6 |
# File 'lib/samsung/protocol/response.rb', line 4 def response_frame @response_frame end |
Instance Method Details
#response_type ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/samsung/protocol/response.rb', line 11 def response_type return :wait if r[0].ord == 0x0a return :timeout if r[0].ord == 0x65 return :accepted if r[0].ord == 0x64 and r[2].ord == 0x01 return :rejected if r[0].ord == 0x64 and r[2].ord == 0x02 return :unknown end |