Class: ONVIF::DeviceManagementAction::GetDeviceInformation
- Defined in:
- lib/ruby_onvif_client/device_management/get_device_information.rb
Instance Method Summary collapse
Methods inherited from Action
#attribute, #callback, #create_event_onvif_message, #create_media_onvif_message, #create_ptz_onvif_message, #initialize, #send_message, #value
Constructor Details
This class inherits a constructor from ONVIF::Action
Instance Method Details
#run(cb) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ruby_onvif_client/device_management/get_device_information.rb', line 6 def run cb = Message.new .body = ->(xml) do xml.wsdl(:GetDeviceInformation) end do |success, result| if success xml_doc = Nokogiri::XML(result[:content]) info = { mf: value(xml_doc, '//tds:Manufacturer'), model: value(xml_doc, '//tds:Model'), firmware_version: value(xml_doc, '//tds:FirmwareVersion'), serial_number: value(xml_doc, '//tds:SerialNumber'), hardware_id: value(xml_doc, '//tds:HardwareId') } callback cb, success, info else callback cb, success, result end end end |