Implemented complete C# gRPC service wrapping GeViScope SDK: ✅ gRPC Protocol Definitions (T011-T014): - common.proto: Status, Error, Timestamp messages - camera.proto: CameraService with ListCameras, GetCamera RPCs - monitor.proto: MonitorService with ListMonitors, GetMonitor RPCs - crossswitch.proto: CrossSwitchService with ExecuteCrossSwitch, ClearMonitor, GetRoutingState, HealthCheck RPCs ✅ SDK Wrapper Classes (T015-T021): - GeViDatabaseWrapper.cs: Connection lifecycle with retry logic (3 attempts, exponential backoff) - StateQueryHandler.cs: GetFirst/GetNext enumeration pattern for cameras/monitors - ActionDispatcher.cs: CrossSwitch and ClearVideoOutput action execution - ErrorTranslator.cs: SDK errors → gRPC status codes → HTTP status codes ✅ gRPC Service Implementations (T022-T026): - CameraService.cs: List/get camera information from GeViServer - MonitorService.cs: List/get monitor/viewer information from GeViServer - CrossSwitchService.cs: Execute cross-switching, clear monitors, query routing state - Program.cs: gRPC server with Serilog logging, dependency injection - appsettings.json: GeViServer connection configuration Key Features: - Async/await pattern throughout - Comprehensive error handling and logging - In-memory routing state tracking - Health check endpoint - Connection retry with exponential backoff - Proper resource disposal Architecture: FastAPI (Python) ←gRPC→ SDK Bridge (C# .NET 8.0) ←SDK→ GeViServer Ready for Phase 3: Python API Foundation 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
41 lines
1.1 KiB
Protocol Buffer
41 lines
1.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option csharp_namespace = "GeViScopeBridge.Protos";
|
|
|
|
package geviscopebridge;
|
|
|
|
import "common.proto";
|
|
|
|
// Camera Service - Video Input Management
|
|
|
|
service CameraService {
|
|
// List all cameras (video inputs)
|
|
rpc ListCameras(ListCamerasRequest) returns (ListCamerasResponse);
|
|
|
|
// Get detailed information about a specific camera
|
|
rpc GetCamera(GetCameraRequest) returns (CameraInfo);
|
|
}
|
|
|
|
message ListCamerasRequest {
|
|
// No parameters needed - returns all cameras
|
|
}
|
|
|
|
message ListCamerasResponse {
|
|
repeated CameraInfo cameras = 1;
|
|
int32 total_count = 2;
|
|
}
|
|
|
|
message GetCameraRequest {
|
|
int32 camera_id = 1; // Channel number
|
|
}
|
|
|
|
message CameraInfo {
|
|
int32 id = 1; // Channel/GlobalID
|
|
string name = 2; // Camera name
|
|
string description = 3; // Optional description
|
|
bool has_ptz = 4; // PTZ capable
|
|
bool has_video_sensor = 5; // Video sensor available
|
|
string status = 6; // "online", "offline", "unknown"
|
|
Timestamp last_seen = 7; // Last activity timestamp
|
|
}
|