# GeViScope SDK Analysis ## Overview GeViScope is Geutebruck's DVR (Digital Video Recorder) system that handles: - Video recording and playback - Camera management (PTZ control) - Event handling - Action-based communication ## SDK Components ### Native Win32 DLLs (32-bit) | DLL | Purpose | |-----|---------| | GscDBI.dll | Database interface - connection, registry, data access | | GscActions.dll | PLC (Process Logic Control) - action/event handling | | GscMediaPlayer.dll | Video display and playback | | GscHelper.dll | Helper functions | ### .NET Wrapper DLLs (.NET 4.0) | DLL | Purpose | |-----|---------| | GscExceptionsNET_4_0.dll | Exception handling | | GscDBINET_4_0.dll | Database interface wrapper | | GscActionsNET_4_0.dll | Actions/PLC wrapper | | GscMediaPlayerNET_4_0.dll | Media player wrapper | ## Key Namespaces ```csharp using GEUTEBRUECK.GeViScope.Wrapper.DBI; using GEUTEBRUECK.GeViScope.Wrapper.Actions; using GEUTEBRUECK.GeViScope.Wrapper.Actions.SystemActions; using GEUTEBRUECK.GeViScope.Wrapper.Actions.DigitalContactsActions; using GEUTEBRUECK.GeViScope.Wrapper.Actions.ActionDispatcher; using GEUTEBRUECK.GeViScope.Wrapper.MediaPlayer; ``` ## Connection Flow 1. Create GscServer instance 2. Encode password: `DBIHelperFunctions.EncodePassword(password)` 3. Set connection parameters: `GscServerConnectParams` 4. Connect: `GscServer.Connect()` 5. Create PLC: `GscServer.CreatePLC()` 6. Subscribe to actions/events 7. Register action dispatcher callbacks ## Key Classes ### GscServer - Main connection class - Methods: `Connect()`, `Disconnect()`, `CreatePLC()`, `CreateRegistry()` ### GscPLCWrapper - Process Logic Control for actions/events - Methods: `OpenPushCallback()`, `SendAction()`, `StartEvent()`, `StopEvent()` - Methods: `SubscribeActionsAll()`, `SubscribeEventsAll()` ### GscActionDispatcher - Dispatches received actions to handlers - Events: `OnCustomAction`, `OnDigitalInput`, `OnCrossSwitch`, etc. ### GscViewer - Video viewer for live/recorded media - Methods: `ConnectDB()`, `SetPlayMode()`, `Refresh()` ## Action Categories 1. **ATM/ACS** - Banking/Access control 2. **Audio Control** - ABC (Audio Back Channel) 3. **Backup Actions** - Auto/event backups 4. **Camera Control** - PTZ, focus, iris, presets 5. **Digital Contacts** - Digital I/O 6. **Switch Control** - CrossSwitch (video routing) 7. **Viewer Actions** - Remote control GSCView 8. **System Actions** - Login, shutdown, events ## Sample Actions ```csharp // Custom Action GscAction action = new GscAct_CustomAction(1, "Hello world!"); plc.SendAction(action); // CrossSwitch GscAction crossSwitch = GscAction.Decode("CrossSwitch(1, 2, 0)"); plc.SendAction(crossSwitch); // PTZ Control GscAction ptzAction = GscAction.Decode("CameraPanLeft(1, 50)"); plc.SendAction(ptzAction); ``` ## TACI - Telnet Action Command Interface Alternative method for sending/receiving actions via Telnet (ASCII format): - Default port: 12007 - Requires GscTelnetActionCommandInterface.dll plugin - Format: Action text commands like `CustomAction(1,"HelloWorld")` ## Default Credentials - Username: `sysadmin` - Password: `masterkey` ## Demo Mode - Full functionality for 2 hours - After timeout, restart GeViScope server for another 2 hours ## Integration Approach Similar to GeViServer, create a C# Bridge service that: 1. References the .NET wrapper DLLs 2. Exposes REST API endpoints 3. Handles connection lifecycle 4. Forwards actions/events ### Proposed Endpoints ``` POST /geviscope/connect POST /geviscope/disconnect GET /geviscope/status GET /geviscope/channels POST /geviscope/action POST /geviscope/event/start POST /geviscope/event/stop POST /geviscope/camera/ptz ``` ## File Locations - SDK: `C:\Program Files (x86)\GeViScopeSDK\` - BIN: `C:\Program Files (x86)\GeViScopeSDK\BIN\` - Examples: `C:\Program Files (x86)\GeViScopeSDK\Examples\` - Documentation: `C:\Program Files (x86)\GeViScopeSDK\Documentation\`