lumeohq / onvif-rs

A native Rust ONVIF client library.
MIT License
114 stars 61 forks source link

example: camera: Add service-path argument #86

Closed patrickelectric closed 2 years ago

patrickelectric commented 2 years ago

Comment necessary to access cameras that does not have the path onvif/device_service

Signed-off-by: Patrick José Pereira patrickelectric@gmail.com

DmitrySamoylov commented 2 years ago

Thanks for the PR. @patrickelectric can you tell please which cameras have such a non-standard path?

I'm asking because from Core spec 5.1.1 it seems this segment is fixed

image

patrickelectric commented 2 years ago

Thanks for the PR. @patrickelectric can you tell please which cameras have such a non-standard path?

I'm asking because from Core spec 5.1.1 it seems this segment is fixed

image

Hi @DmitrySamoylov, I'm using a Tapo C200

cargo run --example camera -- get-all --uri=http://192.168.0.49:2020  --service-path=onvif/service                                                                                                             
   Compiling onvif v0.1.0 (/home/patrick/git/patrick/onvif-rs/onvif)                                                                                                                                                                                          
    Finished dev [unoptimized + debuginfo] target(s) in 6.02s                                                                                                                                                                                                 
     Running `target/debug/examples/camera get-all '--uri=http://192.168.0.49:2020' --service-path=onvif/service`                                                                                                                                             
Ok(                                                                                                                                                                                                                                                           
    GetSystemDateAndTimeResponse {                                                                                                                                                                                                                            
        system_date_and_time: SystemDateTime {                                                                                                                                                                                                                
            date_time_type: Ntp,                                                                                                                                                                                                                              
            daylight_savings: true,                                                                                                                                                                                                                           
            time_zone: Some(                                                                                                                                                                                                                                  
                TimeZone {                                                                                                                                                                                                                                    
                    tz: "GMT+03:00",                                                                                                                                                                                                                          
                },                                                                                                                                                                                                                                            
            ),                                                                                                                                                                                                                                                
            utc_date_time: Some(                                                                                                                                                                                                                              
                DateTime {                                                                                                                                                                                                                                    
                    time: Time {                                                                                                                                                                                                                              
                        hour: 11,                                                                                                                                                                                                                             
                        minute: 40,                                                                                                                                                                                                                           
                        second: 7,                                                                                                                                                                                                                            
                    },                                                                                                                                                                                                                                        
                    date: Date {                                                                                                                                                                                                                              
                        year: 2022,                                                                                                                                                                                                                           
                        month: 1,                                                                                                                                                                                                                             
                        day: 26,                                                                                                                                                                                                                              
                    },                                                                                                                                                                                                                                        
                },                                                                                                                                                                                                                                            
            ),                                                                                                                                                                                                                                                
            local_date_time: Some(                                                                                                                                                                                                                            
                DateTime {                                                                                                                                                                                                                                    
                    time: Time {                                                                                                                                                                                                                              
                        hour: 8,                                                                                                                                                                                                                              
                        minute: 40,                                                                                                                                                                                                                           
                        second: 7,                                                                                                                                                                                                                            
                    },                                                                                                                                                                                                                                        
                    date: Date {                                                                                                                                                                                                                              
                        year: 2022,                                                                                                                                                                                                                           
                        month: 1,                                                                                                                                                                                                                             
                        day: 26,                                                                                                                                                                                                                              
                    },                                                                                                                                                                                                                                        
                },                                                                                                                                                                                                                                            
            ),                                                                                                                                                                                                                                                
            extension: None,                                                                                                                                                                                                                                  
        },                                                                                                                                                                                                                                                    
    },                                                                                                                                                                                                                                                        
)                                                                                                                                                                                                                                                             
GetCapabilitiesResponse {                                                                                                                                                                                                                                     
    capabilities: Capabilities {                                                                                                                                                                                                                              
        analytics: [                                                                                                                                                                                                                                          
            AnalyticsCapabilities {                                                                                                                                                                                                                           
                x_addr: "http://192.168.0.49:2020/onvif/service",                                                                                                                                                                                             
                rule_support: true,                                                                                                                                                                                                                           
                analytics_module_support: true,                                                                                                                                                                                                               
            },                                                                                                                                                                                                                                                
        ],                                                                                                                                                                                                                                                    
        device: [                                                                                                                                                                                                                                             
            DeviceCapabilities {                                                                                                                                                                                                                              
                x_addr: "http://192.168.0.49:2020/onvif/service",                                                                                                                                                                                             
                network: Some(                                                                                                                                                                                                                                
                    NetworkCapabilities {                                                                                                                                                                                                                     
                        ip_filter: Some(                                                                                                                                             
                            false,                                                                                                                                                   
                        ),                                                                                                                                                           
                        zero_configuration: Some(                                                                                                                                    
                            false,                                                                                                                                                   
                        ),                                                                                                                                                           
                        ip_version_6: Some(                                                                                                                                          
                            false,                                                                                                                                                   
                        ),                                                                                                                                                           
                        dyn_dns: Some(                                                                                                                                               
                            false,                                                                                                                                                   
                        ),                                                                                                                                                           
                        extension: Some(                                                                                                                                             
                            NetworkCapabilitiesExtension {                                                                                                                           
                                dot_11_configuration: Some(                                                                                                                          
                                    true,                                                                                                                                            
                                ),                                                                                                                                                   
                            },                                                                                                                                                       
                        ),