feat: add comprehensive ONVIF test reports and enhance documentation
- Introduced CAMERA_TEST_REPORT.md and COMPREHENSIVE_TEST_SUMMARY.md to document testing results for the Bosch FLEXIDOME indoor 5100i IR camera. - Added detailed analysis of ONVIF Media Service operations and implementation status in MEDIA_OPERATIONS_ANALYSIS.md and MEDIA_WSDL_OPERATIONS_ANALYSIS.md. - Updated implementation status documentation to reflect the completion of all 79 operations in the ONVIF Media Service. - Enhanced existing comments and documentation across various files for better clarity and consistency.
This commit is contained in:
+40
-6
@@ -29,6 +29,7 @@ func main() {
|
||||
fmt.Println("0. Exit")
|
||||
fmt.Print("\nChoice: ")
|
||||
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
input, _ := reader.ReadString('\n')
|
||||
choice := strings.TrimSpace(input)
|
||||
|
||||
@@ -45,6 +46,7 @@ func main() {
|
||||
getStreamURLs()
|
||||
case "0", "q", "quit":
|
||||
fmt.Println("Goodbye! 👋")
|
||||
|
||||
return
|
||||
default:
|
||||
fmt.Println("Invalid choice. Please try again.")
|
||||
@@ -60,6 +62,7 @@ func discoverCameras() {
|
||||
|
||||
// Ask if user wants to use a specific interface
|
||||
fmt.Print("Use specific network interface? (y/n) [n]: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
useInterface, _ := reader.ReadString('\n')
|
||||
useInterface = strings.ToLower(strings.TrimSpace(useInterface))
|
||||
|
||||
@@ -69,6 +72,7 @@ func discoverCameras() {
|
||||
interfaces, err := discovery.ListNetworkInterfaces()
|
||||
if err != nil {
|
||||
fmt.Printf("Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -77,8 +81,9 @@ func discoverCameras() {
|
||||
fmt.Printf(" %d. %s (%v)\n", i+1, iface.Name, iface.Addresses)
|
||||
}
|
||||
|
||||
fmt.Print("\nEnter interface name or IP: ")
|
||||
ifaceInput, _ := reader.ReadString('\n')
|
||||
fmt.Print("\nEnter interface name or IP: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
ifaceInput, _ := reader.ReadString('\n')
|
||||
ifaceInput = strings.TrimSpace(ifaceInput)
|
||||
|
||||
if ifaceInput != "" {
|
||||
@@ -98,11 +103,13 @@ func discoverCameras() {
|
||||
devices, err := discovery.DiscoverWithOptions(ctx, 5*time.Second, opts)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if len(devices) == 0 {
|
||||
fmt.Println("No cameras found")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -119,11 +126,13 @@ func listNetworkInterfaces() {
|
||||
interfaces, err := discovery.ListNetworkInterfaces()
|
||||
if err != nil {
|
||||
fmt.Printf("Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if len(interfaces) == 0 {
|
||||
fmt.Println("No network interfaces found")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -154,10 +163,12 @@ func connectAndShowInfo() {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
|
||||
fmt.Print("Camera IP: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
ip, _ := reader.ReadString('\n')
|
||||
ip = strings.TrimSpace(ip)
|
||||
|
||||
fmt.Print("Username [admin]: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
username, _ := reader.ReadString('\n')
|
||||
username = strings.TrimSpace(username)
|
||||
if username == "" {
|
||||
@@ -165,6 +176,7 @@ func connectAndShowInfo() {
|
||||
}
|
||||
|
||||
fmt.Print("Password: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
password, _ := reader.ReadString('\n')
|
||||
password = strings.TrimSpace(password)
|
||||
|
||||
@@ -178,6 +190,7 @@ func connectAndShowInfo() {
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -187,6 +200,7 @@ func connectAndShowInfo() {
|
||||
info, err := client.GetDeviceInformation(ctx)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Connection failed: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -195,7 +209,8 @@ func connectAndShowInfo() {
|
||||
fmt.Printf("🔧 Firmware: %s\n", info.FirmwareVersion)
|
||||
|
||||
// Initialize and get profiles
|
||||
_ = client.Initialize(ctx) // Ignore initialization errors, we'll catch them on GetProfiles
|
||||
//nolint:errcheck // Ignore initialization errors, we'll catch them on GetProfiles
|
||||
_ = client.Initialize(ctx)
|
||||
profiles, err := client.GetProfiles(ctx)
|
||||
if err == nil && len(profiles) > 0 {
|
||||
fmt.Printf("📺 %d profile(s) available\n", len(profiles))
|
||||
@@ -212,10 +227,12 @@ func ptzDemo() {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
|
||||
fmt.Print("Camera IP: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
ip, _ := reader.ReadString('\n')
|
||||
ip = strings.TrimSpace(ip)
|
||||
|
||||
fmt.Print("Username [admin]: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
username, _ := reader.ReadString('\n')
|
||||
username = strings.TrimSpace(username)
|
||||
if username == "" {
|
||||
@@ -223,6 +240,7 @@ func ptzDemo() {
|
||||
}
|
||||
|
||||
fmt.Print("Password: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
password, _ := reader.ReadString('\n')
|
||||
password = strings.TrimSpace(password)
|
||||
|
||||
@@ -234,15 +252,18 @@ func ptzDemo() {
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
_ = client.Initialize(ctx) // Ignore initialization errors, we'll catch them on GetProfiles
|
||||
//nolint:errcheck // Ignore initialization errors, we'll catch them on GetProfiles
|
||||
_ = client.Initialize(ctx)
|
||||
|
||||
profiles, err := client.GetProfiles(ctx)
|
||||
if err != nil || len(profiles) == 0 {
|
||||
fmt.Println("❌ No profiles found")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -252,6 +273,7 @@ func ptzDemo() {
|
||||
status, err := client.GetStatus(ctx, profileToken)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ PTZ not supported: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -269,6 +291,7 @@ func ptzDemo() {
|
||||
fmt.Println("5. Go to center")
|
||||
fmt.Print("Choice: ")
|
||||
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
choice, _ := reader.ReadString('\n')
|
||||
choice = strings.TrimSpace(choice)
|
||||
|
||||
@@ -288,6 +311,7 @@ func ptzDemo() {
|
||||
position = &onvif.PTZVector{PanTilt: &onvif.Vector2D{X: 0.0, Y: 0.0}}
|
||||
default:
|
||||
fmt.Println("Invalid choice")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -296,15 +320,18 @@ func ptzDemo() {
|
||||
err = client.ContinuousMove(ctx, profileToken, velocity, &timeout)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
fmt.Println("✅ Moving for 2 seconds...")
|
||||
time.Sleep(2 * time.Second)
|
||||
_ = client.Stop(ctx, profileToken, true, false) // Stop PTZ movement
|
||||
//nolint:errcheck // Stop error is not critical for demo
|
||||
_ = client.Stop(ctx, profileToken, true, false)
|
||||
} else if position != nil {
|
||||
err = client.AbsoluteMove(ctx, profileToken, position, nil)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
fmt.Println("✅ Moving to center...")
|
||||
@@ -317,10 +344,12 @@ func getStreamURLs() {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
|
||||
fmt.Print("Camera IP: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
ip, _ := reader.ReadString('\n')
|
||||
ip = strings.TrimSpace(ip)
|
||||
|
||||
fmt.Print("Username [admin]: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
username, _ := reader.ReadString('\n')
|
||||
username = strings.TrimSpace(username)
|
||||
if username == "" {
|
||||
@@ -328,6 +357,7 @@ func getStreamURLs() {
|
||||
}
|
||||
|
||||
fmt.Print("Password: ")
|
||||
//nolint:errcheck // ReadString error on stdin is rare and not critical for CLI
|
||||
password, _ := reader.ReadString('\n')
|
||||
password = strings.TrimSpace(password)
|
||||
|
||||
@@ -339,20 +369,24 @@ func getStreamURLs() {
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
_ = client.Initialize(ctx) // Ignore initialization errors, we'll catch them on GetProfiles
|
||||
//nolint:errcheck // Ignore initialization errors, we'll catch them on GetProfiles
|
||||
_ = client.Initialize(ctx)
|
||||
|
||||
profiles, err := client.GetProfiles(ctx)
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Error: %v\n", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if len(profiles) == 0 {
|
||||
fmt.Println("❌ No profiles found")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user