Class: ONVIF::Event

Inherits:
Service show all
Defined in:
lib/ruby_onvif_client/event.rb

Instance Method Summary collapse

Methods inherited from Service

#initialize, #method_missing, #respond_to?

Constructor Details

This class inherits a constructor from ONVIF::Service

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ONVIF::Service

Instance Method Details

#get_event_service_address(cb) ⇒ Object

end



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ruby_onvif_client/event.rb', line 12

def get_event_service_address cb
    @res = {}
    device_management = ONVIF::DeviceManagement.new("http://192.168.16.106/onvif/device_service")
    content = [{:Category => 'Events'}]
    device_management.get_capabilities content, ->(success, result) {
        if success
            puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%success%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
            #puts result
            @res[:address] = result[:events][:x_addr]
            @res[:subscription_policy_support] = result[:events][:wssubscription_policy_support]
            @res[:pull_point_support] = result[:events][:wspull_point_support]
            @res[:pausable_subscription_manager_interface_support] = result[:events][:wspsmis]
            #puts @res
            cb.call  @res[:address]
        end
    }
end