From ce3625401f039dfdc1a8845f9acc51583b985883 Mon Sep 17 00:00:00 2001 From: Dominic Betts <1454644+dominicbetts@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:50:40 +0000 Subject: [PATCH] Add ONVIF PTZ sample (#108) ## Purpose Add the ONVIF PTZ demo app ## Does this introduce a breaking change? ``` [ ] Yes [x] No ``` ## Pull Request Type What kind of change does this Pull Request introduce? ``` [ ] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [x] Documentation content changes [ ] Other... Please describe: ``` ## Other Information This sample is referenced from Microsoft Learn docs --- .../aio-onvif-connector-ptz-demo/.gitignore | 484 ++++++++++++++++ .../Aio.Onvif.Connector.Ptz.Demo.sln | 31 ++ .../Aio.Onvif.Connector.Ptz.Demo.csproj | 19 + .../Aio.Onvif.Connector.Ptz.Demo/Program.cs | 113 ++++ .../Aio.Onvif.Connector.Ptz.Demo/PtzClient.cs | 12 + .../PTZ/BytesJsonConverter.cs | 26 + .../PTZ/CombinedPrefixedReadOnlyDictionary.cs | 108 ++++ .../PTZ/DateJsonConverter.cs | 27 + .../PTZ/DecimalJsonConverter.cs | 27 + .../PTZ/DecimalString.cs | 91 +++ .../PTZ/DurationJsonConverter.cs | 27 + .../PTZ/EmptyJson.cs | 8 + .../PTZ/PTZ.csproj | 17 + .../PTZ/TimeJsonConverter.cs | 27 + .../PTZ/Utf8JsonSerializer.cs | 72 +++ .../PTZ/UuidJsonConverter.cs | 26 + .../AbsoluteMoveCommandExecutor.g.cs | 32 ++ .../AbsoluteMoveCommandInvoker.g.cs | 30 + .../AbsoluteMoveRequestPayload.g.cs | 38 ++ .../ContinuousMoveCommandExecutor.g.cs | 32 ++ .../ContinuousMoveCommandInvoker.g.cs | 30 + .../ContinuousMoveRequestPayload.g.cs | 38 ++ .../Enum_Onvif_Ptz_EFlipMode__1.g.cs | 14 + .../Enum_Onvif_Ptz_MoveStatus__1.g.cs | 13 + ...m_Onvif_Ptz_PTZPresetTourOperation__1.g.cs | 15 + .../Enum_Onvif_Ptz_ReverseMode__1.g.cs | 15 + .../GetConfigurationCommandExecutor.g.cs | 32 ++ .../GetConfigurationCommandInvoker.g.cs | 30 + ...etConfigurationOptionsCommandExecutor.g.cs | 32 ++ ...GetConfigurationOptionsCommandInvoker.g.cs | 30 + ...GetConfigurationOptionsRequestPayload.g.cs | 38 ++ ...etConfigurationOptionsResponsePayload.g.cs | 38 ++ .../GetConfigurationRequestPayload.g.cs | 38 ++ .../GetConfigurationResponsePayload.g.cs | 38 ++ .../GetConfigurationsCommandExecutor.g.cs | 32 ++ .../GetConfigurationsCommandInvoker.g.cs | 30 + .../GetConfigurationsResponsePayload.g.cs | 38 ++ .../GetNodeCommandExecutor.g.cs | 32 ++ .../GetNodeCommandInvoker.g.cs | 30 + .../GetNodeRequestPayload.g.cs | 38 ++ .../GetNodeResponsePayload.g.cs | 38 ++ .../GetNodesCommandExecutor.g.cs | 32 ++ .../GetNodesCommandInvoker.g.cs | 30 + .../GetNodesResponsePayload.g.cs | 38 ++ .../GetPresetsCommandExecutor.g.cs | 32 ++ .../GetPresetsCommandInvoker.g.cs | 30 + .../GetPresetsRequestPayload.g.cs | 38 ++ .../GetPresetsResponsePayload.g.cs | 38 ++ .../GetStatusCommandExecutor.g.cs | 32 ++ .../GetStatusCommandInvoker.g.cs | 30 + .../GetStatusRequestPayload.g.cs | 38 ++ .../GetStatusResponsePayload.g.cs | 38 ++ .../GotoHomePositionCommandExecutor.g.cs | 32 ++ .../GotoHomePositionCommandInvoker.g.cs | 30 + .../GotoHomePositionRequestPayload.g.cs | 38 ++ .../GotoPresetCommandExecutor.g.cs | 32 ++ .../GotoPresetCommandInvoker.g.cs | 30 + .../GotoPresetRequestPayload.g.cs | 38 ++ .../Object_Onvif_Ptz_AbsoluteMove__1.g.cs | 36 ++ .../Object_Onvif_Ptz_AuxiliaryData__1.g.cs | 15 + .../Object_Onvif_Ptz_ContinuousMove__1.g.cs | 36 ++ ...tz_GetConfigurationOptionsResponse__1.g.cs | 22 + ..._Onvif_Ptz_GetConfigurationOptions__1.g.cs | 22 + .../Object_Onvif_Ptz_GetConfiguration__1.g.cs | 22 + ...nvif_Ptz_GetConfigurationsResponse__1.g.cs | 22 + .../Object_Onvif_Ptz_GetNodeRequest__1.g.cs | 22 + ...bject_Onvif_Ptz_GetPresetsResponse__1.g.cs | 22 + .../Object_Onvif_Ptz_GetPresets__1.g.cs | 22 + ...Object_Onvif_Ptz_GetStatusResponse__1.g.cs | 22 + .../Object_Onvif_Ptz_GetStatus__1.g.cs | 22 + .../Object_Onvif_Ptz_GotoHomePosition__1.g.cs | 29 + .../Object_Onvif_Ptz_GotoPreset__1.g.cs | 36 ++ ..._Onvif_Ptz_PTZConfigurationOptions__1.g.cs | 50 ++ .../Object_Onvif_Ptz_PTZConfiguration__1.g.cs | 141 +++++ ...Object_Onvif_Ptz_PTZNodeExtension2__1.g.cs | 15 + .../Object_Onvif_Ptz_PTZNodeExtension__1.g.cs | 29 + .../Object_Onvif_Ptz_PTZNode__1.g.cs | 78 +++ ...tz_PTZPresetTourSupportedExtension__1.g.cs | 15 + ...t_Onvif_Ptz_PTZPresetTourSupported__1.g.cs | 36 ++ .../Object_Onvif_Ptz_PTZPreset__1.g.cs | 36 ++ .../Object_Onvif_Ptz_PTZSpaces__1.g.cs | 71 +++ .../Object_Onvif_Ptz_PTZSpeed__1.g.cs | 29 + .../Object_Onvif_Ptz_PTZStatus__1.g.cs | 43 ++ .../Object_Onvif_Ptz_PTZVector__1.g.cs | 29 + .../Object_Onvif_Ptz_RelativeMove__1.g.cs | 36 ++ .../Object_Onvif_Ptz_RemovePreset__1.g.cs | 29 + ...f_Ptz_SendAuxiliaryCommandResponse__1.g.cs | 22 + ...ect_Onvif_Ptz_SendAuxiliaryCommand__1.g.cs | 29 + .../Object_Onvif_Ptz_SetConfiguration__1.g.cs | 29 + .../Object_Onvif_Ptz_SetHomePosition__1.g.cs | 22 + ...Object_Onvif_Ptz_SetPresetResponse__1.g.cs | 22 + .../Object_Onvif_Ptz_SetPreset__1.g.cs | 36 ++ ...bject_Onvif_Ptz_Space1DDescription__1.g.cs | 36 ++ ...bject_Onvif_Ptz_Space2DDescription__1.g.cs | 50 ++ .../Object_Onvif_Ptz_Stop__1.g.cs | 36 ++ .../Object_Onvif_Ptz_Vector1D__1.g.cs | 29 + .../Object_Onvif_Ptz_Vector2D__1.g.cs | 36 ++ ...ect_PTZConfigurationOptions_Extension.g.cs | 15 + ...nfigurationOptions_PTControlDirection.g.cs | 36 ++ ...ationOptions_PTControlDirection_EFlip.g.cs | 29 + ...ns_PTControlDirection_EFlip_Extension.g.cs | 15 + ...nOptions_PTControlDirection_Extension.g.cs | 15 + ...ionOptions_PTControlDirection_Reverse.g.cs | 29 + ..._PTControlDirection_Reverse_Extension.g.cs | 15 + ...ct_PTZConfigurationOptions_PTZTimeout.g.cs | 29 + .../Object_PTZConfiguration_Extension.g.cs | 29 + ..._PTZConfiguration_Extension_Extension.g.cs | 15 + ...guration_Extension_PTControlDirection.g.cs | 29 + ...Object_PTZConfiguration_PanTiltLimits.g.cs | 22 + .../Object_PTZConfiguration_ZoomLimits.g.cs | 22 + .../Object_PTZStatus_MoveStatus.g.cs | 29 + .../PTZ/dtmi_onvif_ptz__1/Ptz.g.cs | 525 ++++++++++++++++++ .../RelativeMoveCommandExecutor.g.cs | 32 ++ .../RelativeMoveCommandInvoker.g.cs | 30 + .../RelativeMoveRequestPayload.g.cs | 38 ++ .../RemovePresetCommandExecutor.g.cs | 32 ++ .../RemovePresetCommandInvoker.g.cs | 30 + .../RemovePresetRequestPayload.g.cs | 38 ++ .../SendAuxiliaryCommandCommandExecutor.g.cs | 32 ++ .../SendAuxiliaryCommandCommandInvoker.g.cs | 30 + .../SendAuxiliaryCommandRequestPayload.g.cs | 38 ++ .../SendAuxiliaryCommandResponsePayload.g.cs | 38 ++ .../SetConfigurationCommandExecutor.g.cs | 32 ++ .../SetConfigurationCommandInvoker.g.cs | 30 + .../SetConfigurationRequestPayload.g.cs | 38 ++ .../SetHomePositionCommandExecutor.g.cs | 32 ++ .../SetHomePositionCommandInvoker.g.cs | 30 + .../SetHomePositionRequestPayload.g.cs | 38 ++ .../SetPresetCommandExecutor.g.cs | 32 ++ .../SetPresetCommandInvoker.g.cs | 30 + .../SetPresetRequestPayload.g.cs | 38 ++ .../SetPresetResponsePayload.g.cs | 38 ++ .../StopCommandExecutor.g.cs | 32 ++ .../dtmi_onvif_ptz__1/StopCommandInvoker.g.cs | 30 + .../dtmi_onvif_ptz__1/StopRequestPayload.g.cs | 38 ++ .../aio-onvif-connector-ptz-demo/README.md | 235 ++++++++ .../aio-onvif-connector-ptz-demo/nuget.config | 6 + 137 files changed, 5667 insertions(+) create mode 100644 samples/aio-onvif-connector-ptz-demo/.gitignore create mode 100644 samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo.sln create mode 100644 samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/Aio.Onvif.Connector.Ptz.Demo.csproj create mode 100644 samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/Program.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/PtzClient.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/BytesJsonConverter.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/CombinedPrefixedReadOnlyDictionary.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/DateJsonConverter.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/DecimalJsonConverter.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/DecimalString.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/DurationJsonConverter.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/EmptyJson.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/PTZ.csproj create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/TimeJsonConverter.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/Utf8JsonSerializer.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/UuidJsonConverter.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_EFlipMode__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_MoveStatus__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_PTZPresetTourOperation__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_ReverseMode__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_AbsoluteMove__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_AuxiliaryData__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_ContinuousMove__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationOptionsResponse__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationOptions__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfiguration__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationsResponse__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetNodeRequest__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetPresetsResponse__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetPresets__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetStatusResponse__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetStatus__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GotoHomePosition__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GotoPreset__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZConfigurationOptions__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZConfiguration__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNodeExtension2__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNodeExtension__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNode__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPresetTourSupportedExtension__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPresetTourSupported__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPreset__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZSpaces__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZSpeed__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZStatus__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZVector__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_RelativeMove__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_RemovePreset__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SendAuxiliaryCommandResponse__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SendAuxiliaryCommand__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetConfiguration__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetHomePosition__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetPresetResponse__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetPreset__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Space1DDescription__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Space2DDescription__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Stop__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Vector1D__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Vector2D__1.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_Extension.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_EFlip.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_EFlip_Extension.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Extension.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Reverse.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Reverse_Extension.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTZTimeout.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension_Extension.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension_PTControlDirection.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_PanTiltLimits.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_ZoomLimits.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZStatus_MoveStatus.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Ptz.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetResponsePayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopCommandExecutor.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopCommandInvoker.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopRequestPayload.g.cs create mode 100644 samples/aio-onvif-connector-ptz-demo/README.md create mode 100644 samples/aio-onvif-connector-ptz-demo/nuget.config diff --git a/samples/aio-onvif-connector-ptz-demo/.gitignore b/samples/aio-onvif-connector-ptz-demo/.gitignore new file mode 100644 index 0000000..bc78471 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/.gitignore @@ -0,0 +1,484 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from `dotnet new gitignore` + +# dotenv files +.env + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea/ + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo.sln b/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo.sln new file mode 100644 index 0000000..5f07c7a --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aio.Onvif.Connector.Ptz.Demo", "Aio.Onvif.Connector.Ptz.Demo\Aio.Onvif.Connector.Ptz.Demo.csproj", "{BE93AC76-C663-47D1-9C3A-E18E32E18A3F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PTZ", "PTZ\PTZ.csproj", "{2EC99FE6-8C42-4AAE-ABCD-DE4291ED2655}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BE93AC76-C663-47D1-9C3A-E18E32E18A3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE93AC76-C663-47D1-9C3A-E18E32E18A3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE93AC76-C663-47D1-9C3A-E18E32E18A3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE93AC76-C663-47D1-9C3A-E18E32E18A3F}.Release|Any CPU.Build.0 = Release|Any CPU + {2EC99FE6-8C42-4AAE-ABCD-DE4291ED2655}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2EC99FE6-8C42-4AAE-ABCD-DE4291ED2655}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2EC99FE6-8C42-4AAE-ABCD-DE4291ED2655}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2EC99FE6-8C42-4AAE-ABCD-DE4291ED2655}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8AC4980E-CA54-4BB8-B99D-BC2A701A68CF} + EndGlobalSection +EndGlobal diff --git a/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/Aio.Onvif.Connector.Ptz.Demo.csproj b/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/Aio.Onvif.Connector.Ptz.Demo.csproj new file mode 100644 index 0000000..75409cc --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/Aio.Onvif.Connector.Ptz.Demo.csproj @@ -0,0 +1,19 @@ + + + + + + + + + + + + Exe + net8.0 + Aio.Onvif.Connector.Ptz.Demo + enable + enable + + + diff --git a/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/Program.cs b/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/Program.cs new file mode 100644 index 0000000..97d57e0 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/Program.cs @@ -0,0 +1,113 @@ +using Aio.Onvif.Connector.Ptz.Demo; +using Azure.Iot.Operations.Mqtt.Session; +using Azure.Iot.Operations.Protocol.Models; +using PTZ.dtmi_onvif_ptz__1; + +Console.Write("Mqtt Broker Host: "); +var host = Console.ReadLine(); +if (string.IsNullOrWhiteSpace(host)) +{ + Console.Error.WriteLine("Invalid host"); + Environment.Exit(1); +} + +Console.Write("Mqtt Broker Port: "); +if (!int.TryParse(Console.ReadLine(), out var port)) +{ + Console.Error.WriteLine("Invalid port number"); + Environment.Exit(1); +} + +Console.Write("AIO Namespace: "); +var aioNamespace = Console.ReadLine(); +if (string.IsNullOrWhiteSpace(aioNamespace)) +{ + Console.Error.WriteLine("Invalid AIO namespace"); + Environment.Exit(1); +} + +Console.Write("Asset Name: "); +var assetName = Console.ReadLine(); +if (string.IsNullOrWhiteSpace(assetName)) +{ + Console.Error.WriteLine("Invalid asset name"); + Environment.Exit(1); +} + +Console.Write("Profile Token: "); +var profileToken = Console.ReadLine(); +if (string.IsNullOrWhiteSpace(profileToken)) +{ + Console.Error.WriteLine("Invalid profile token"); + Environment.Exit(1); +} + +Console.Clear(); + +var mqttClientTcpOptions = new MqttClientTcpOptions(host, port); + +var mqttClientOptions = new MqttClientOptions(mqttClientTcpOptions) { SessionExpiryInterval = 60 }; + +var mqttSessionClient = new MqttSessionClient(new MqttSessionClientOptions()); + +await mqttSessionClient.ConnectAsync(mqttClientOptions).ConfigureAwait(true); +var client = new PtzClient(mqttSessionClient); +client.CustomTopicTokenMap.Add("asset", assetName); +client.CustomTopicTokenMap.Add("namespace", aioNamespace); + +Console.WriteLine("Use arrow keys or WASD to move camera, Q to quit"); + +while (true) +{ + var key = Console.ReadKey(true).Key; + if (key == ConsoleKey.Q) + { + break; + } + + (float x, float y)? delta = key switch + { + ConsoleKey.UpArrow => (0, 0.2f), + ConsoleKey.DownArrow => (0, -0.2f), + ConsoleKey.LeftArrow => (0.2f, 0), + ConsoleKey.RightArrow => (-0.2f, 0), + ConsoleKey.W => (0, 0.2f), + ConsoleKey.S => (0, -0.2f), + ConsoleKey.A => (0.2f, 0), + ConsoleKey.D => (-0.2f, 0), + _ => null + }; + + if (delta == null) + { + continue; + } + + try + { + var request = new RelativeMoveRequestPayload + { + RelativeMove = new Object_Onvif_Ptz_RelativeMove__1 + { + ProfileToken = profileToken, + Translation = new Object_Onvif_Ptz_PTZVector__1 + { + PanTilt = new Object_Onvif_Ptz_Vector2D__1 + { + X = delta.Value.x, + Y = delta.Value.y, + } + } + } + }; + + await client.RelativeMoveAsync(request); + } + catch (System.Exception) + { + // Bad request is expected if the camera reaches the limit + } + + await Task.Delay(200).ConfigureAwait(true); +} + diff --git a/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/PtzClient.cs b/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/PtzClient.cs new file mode 100644 index 0000000..04680a8 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/Aio.Onvif.Connector.Ptz.Demo/PtzClient.cs @@ -0,0 +1,12 @@ +using System; +using Azure.Iot.Operations.Protocol; +using static PTZ.dtmi_onvif_ptz__1.Ptz; + +namespace Aio.Onvif.Connector.Ptz.Demo; + +public class PtzClient : Client +{ + public PtzClient(IMqttPubSubClient mqttClient) : base(mqttClient) + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/BytesJsonConverter.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/BytesJsonConverter.cs new file mode 100644 index 0000000..36f006d --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/BytesJsonConverter.cs @@ -0,0 +1,26 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Text.Json; + using System.Text.Json.Serialization; + + /// + /// Class for customized JSON conversion of byte[] values to/from Base64 string representations per RFC 4648. + /// + internal sealed class BytesJsonConverter : JsonConverter + { + /// + public override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return Convert.FromBase64String(reader.GetString()!); + } + + /// + public override void Write(Utf8JsonWriter writer, byte[] value, JsonSerializerOptions options) + { + writer.WriteStringValue(Convert.ToBase64String(value)); + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/CombinedPrefixedReadOnlyDictionary.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/CombinedPrefixedReadOnlyDictionary.cs new file mode 100644 index 0000000..14d0bd4 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/CombinedPrefixedReadOnlyDictionary.cs @@ -0,0 +1,108 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An implementation of IReadOnlyDictionary that combines two IReadOnlyDictionary objects by prefixng their string keys. + /// + /// The type of keys in the combined dictionary. + /// The type of values in the combined dictionary. + public class CombinedPrefixedReadOnlyDictionary : IReadOnlyDictionary + { + private string prefix1; + private IReadOnlyDictionary dict1; + private string prefix2; + private IReadOnlyDictionary dict2; + + /// + /// Initializes a new instance of the class. + /// + /// The prefix for keys in . + /// One of the IReadOnlyDictionary objects to combine. + /// The prefix for keys in . + /// The other IReadOnlyDictionary object to combine. + public CombinedPrefixedReadOnlyDictionary( + string prefix1, + IReadOnlyDictionary dict1, + string prefix2, + IReadOnlyDictionary dict2) + { + ArgumentNullException.ThrowIfNull(prefix1, nameof(prefix1)); + ArgumentNullException.ThrowIfNull(dict1, nameof(dict1)); + ArgumentNullException.ThrowIfNull(prefix2, nameof(prefix2)); + ArgumentNullException.ThrowIfNull(dict2, nameof(dict2)); + + this.prefix1 = prefix1; + this.dict1 = dict1; + this.prefix2 = prefix2; + this.dict2 = dict2; + } + + /// + IEnumerable IReadOnlyDictionary.Keys => this.dict1.Keys.Select(k => $"{this.prefix1}{k}").Concat(this.dict2.Keys.Select(k => $"{this.prefix2}{k}")); + + /// + IEnumerable IReadOnlyDictionary.Values => this.dict1.Values.Concat(this.dict2.Values); + + /// + int IReadOnlyCollection>.Count => this.dict1.Count + this.dict2.Count; + + /// + TValue IReadOnlyDictionary.this[string key] => + key.StartsWith(this.prefix1, StringComparison.InvariantCulture) && this.dict1.TryGetValue(key.Substring(this.prefix1.Length), out TValue? value1) ? value1 : + key.StartsWith(this.prefix2, StringComparison.InvariantCulture) && this.dict2.TryGetValue(key.Substring(this.prefix2.Length), out TValue? value2) ? value2 : + default(TValue)!; + + /// + bool IReadOnlyDictionary.ContainsKey(string key) + { + return + key.StartsWith(this.prefix1, StringComparison.InvariantCulture) && this.dict1.ContainsKey(key.Substring(this.prefix1.Length)) || + key.StartsWith(this.prefix2, StringComparison.InvariantCulture) && this.dict2.ContainsKey(key.Substring(this.prefix2.Length)); + } + + /// + IEnumerator> IEnumerable>.GetEnumerator() + { + foreach (var item in this.dict1) + { + yield return new KeyValuePair($"{this.prefix1}{item.Key}", item.Value); + } + + foreach (var item in this.dict2) + { + yield return new KeyValuePair($"{this.prefix2}{item.Key}", item.Value); + } + } + + /// + bool IReadOnlyDictionary.TryGetValue(string key, out TValue value) + { + if (key.StartsWith(this.prefix1, StringComparison.InvariantCulture) && this.dict1.TryGetValue(key.Substring(this.prefix1.Length), out TValue? value1)) + { + value = value1; + return true; + } + + if (key.StartsWith(this.prefix2, StringComparison.InvariantCulture) && this.dict2.TryGetValue(key.Substring(this.prefix2.Length), out TValue? value2)) + { + value = value2; + return true; + } + + value = default(TValue)!; + return false; + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable>)this).GetEnumerator(); + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/DateJsonConverter.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/DateJsonConverter.cs new file mode 100644 index 0000000..d32de2f --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/DateJsonConverter.cs @@ -0,0 +1,27 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Globalization; + using System.Text.Json; + using System.Text.Json.Serialization; + + /// + /// Class for customized JSON conversion of DateOnly values to/from string representations in ISO 8601 Date format. + /// + internal sealed class DateJsonConverter : JsonConverter + { + /// + public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return DateOnly.Parse(reader.GetString()!, CultureInfo.InvariantCulture); + } + + /// + public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString("o", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/DecimalJsonConverter.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/DecimalJsonConverter.cs new file mode 100644 index 0000000..a1e8da7 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/DecimalJsonConverter.cs @@ -0,0 +1,27 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Text.Json; + using System.Text.Json.Serialization; + using PTZ; + + /// + /// Class for customized JSON conversion of DecimalString values to/from strings. + /// + internal sealed class DecimalJsonConverter : JsonConverter + { + /// + public override DecimalString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new DecimalString(reader.GetString()!); + } + + /// + public override void Write(Utf8JsonWriter writer, DecimalString value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString()); + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/DecimalString.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/DecimalString.cs new file mode 100644 index 0000000..99d33d9 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/DecimalString.cs @@ -0,0 +1,91 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Globalization; + using System.Text.RegularExpressions; + + public class DecimalString + { + private static readonly Regex validationRegex = new Regex("^(?:\\+|-)?(?:[1-9][0-9]*|0)(?:\\.[0-9]*)?$", RegexOptions.Compiled); + + private readonly string value; + + public static bool TryParse(string value, out DecimalString? decimalString) + { + if (validationRegex.IsMatch(value)) + { + decimalString = new DecimalString(value, skipValidation: true); + return true; + } + else + { + decimalString = null; + return false; + } + } + + public DecimalString() + : this("0", skipValidation: false) + { + } + + public DecimalString(string value) + : this(value, skipValidation: false) + { + } + + public static implicit operator string(DecimalString decimalString) => decimalString.value; + public static explicit operator DecimalString(string stringVal) => new DecimalString(stringVal); + + public static implicit operator double(DecimalString decimalString) => double.TryParse(decimalString.value, out double doubleVal) ? doubleVal : double.NaN; + public static explicit operator DecimalString(double doubleVal) => new DecimalString(doubleVal.ToString("F", CultureInfo.InvariantCulture)); + + public static bool operator !=(DecimalString? x, DecimalString? y) + { + if (ReferenceEquals(null, x)) + { + return !ReferenceEquals(null, y); + } + + return !x.Equals(y); + } + + public static bool operator ==(DecimalString? x, DecimalString? y) + { + if (ReferenceEquals(null, x)) + { + return ReferenceEquals(null, y); + } + + return x.Equals(y); + } + + public virtual bool Equals(DecimalString? other) + { + return other?.value == this?.value; + } + + public override bool Equals(object? obj) + { + return obj is DecimalString other && this.Equals(other); + } + public override int GetHashCode() + { + return this.value.GetHashCode(); + } + + private DecimalString(string value, bool skipValidation) + { + if (!skipValidation && !validationRegex.IsMatch(value)) + { + throw new ArgumentException($"string {value} is not a valid decimal value"); + } + + this.value = value; + } + + public override string ToString() => value; + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/DurationJsonConverter.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/DurationJsonConverter.cs new file mode 100644 index 0000000..6c7dfa4 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/DurationJsonConverter.cs @@ -0,0 +1,27 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Text.Json; + using System.Text.Json.Serialization; + using System.Xml; + + /// + /// Class for customized JSON conversion of TimeSpan values to/from string representations in ISO 8601 Duration format. + /// + internal sealed class DurationJsonConverter : JsonConverter + { + /// + public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return XmlConvert.ToTimeSpan(reader.GetString()!); + } + + /// + public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options) + { + writer.WriteStringValue(XmlConvert.ToString(value)); + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/EmptyJson.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/EmptyJson.cs new file mode 100644 index 0000000..e0ceeaa --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/EmptyJson.cs @@ -0,0 +1,8 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + public class EmptyJson + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/PTZ.csproj b/samples/aio-onvif-connector-ptz-demo/PTZ/PTZ.csproj new file mode 100644 index 0000000..26f62c5 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/PTZ.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + latest-recommended + enable + + + + + + + + + + + diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/TimeJsonConverter.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/TimeJsonConverter.cs new file mode 100644 index 0000000..840a3ec --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/TimeJsonConverter.cs @@ -0,0 +1,27 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Globalization; + using System.Text.Json; + using System.Text.Json.Serialization; + + /// + /// Class for customized JSON conversion of TimeOnly values to/from string representations in ISO 8601 Time format. + /// + internal sealed class TimeJsonConverter : JsonConverter + { + /// + public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return TimeOnly.FromDateTime(DateTime.Parse(reader.GetString()!, CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault | DateTimeStyles.AdjustToUniversal)); + } + + /// + public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString("o", CultureInfo.InvariantCulture) + "Z"); + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/Utf8JsonSerializer.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/Utf8JsonSerializer.cs new file mode 100644 index 0000000..92420a3 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/Utf8JsonSerializer.cs @@ -0,0 +1,72 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Text.Json; + using System.Text.Json.Serialization; + using Azure.Iot.Operations.Protocol; + + public class Utf8JsonSerializer : IPayloadSerializer + { + protected static readonly JsonSerializerOptions jsonSerializerOptions = new() + { + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new DurationJsonConverter(), + new DateJsonConverter(), + new TimeJsonConverter(), + new UuidJsonConverter(), + new BytesJsonConverter(), + new DecimalJsonConverter(), + } + }; + + public string ContentType => "application/json"; + + public int CharacterDataFormatIndicator => 1; + + public T FromBytes(byte[]? payload) + where T : class + { + try + { + if (payload == null || payload.Length == 0) + { + if (typeof(T) != typeof(EmptyJson)) + { + throw AkriMqttException.GetPayloadInvalidException(); + } + + return (new EmptyJson() as T)!; + } + + Utf8JsonReader reader = new(payload); + return JsonSerializer.Deserialize(ref reader, jsonSerializerOptions)!; + } + catch (Exception) + { + throw AkriMqttException.GetPayloadInvalidException(); + } + } + + public byte[]? ToBytes(T? payload) + where T : class + { + try + { + if (typeof(T) == typeof(EmptyJson)) + { + return null; + } + + return JsonSerializer.SerializeToUtf8Bytes(payload, jsonSerializerOptions); + } + catch (Exception) + { + throw AkriMqttException.GetPayloadInvalidException(); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/UuidJsonConverter.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/UuidJsonConverter.cs new file mode 100644 index 0000000..465db19 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/UuidJsonConverter.cs @@ -0,0 +1,26 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +namespace PTZ +{ + using System; + using System.Text.Json; + using System.Text.Json.Serialization; + + /// + /// Class for customized JSON conversion of Guid values to/from UUID string representations per RFC 9562. + /// + internal sealed class UuidJsonConverter : JsonConverter + { + /// + public override Guid Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return Guid.ParseExact(reader.GetString()!, "D"); + } + + /// + public override void Write(Utf8JsonWriter writer, Guid value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString("D")); + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveCommandExecutor.g.cs new file mode 100644 index 0000000..e58fc31 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'AbsoluteMove'. + /// + public class AbsoluteMoveCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal AbsoluteMoveCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "AbsoluteMove", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveCommandInvoker.g.cs new file mode 100644 index 0000000..1aab461 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'AbsoluteMove'. + /// + public class AbsoluteMoveCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal AbsoluteMoveCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "AbsoluteMove", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveRequestPayload.g.cs new file mode 100644 index 0000000..6b8c8a7 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/AbsoluteMoveRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class AbsoluteMoveRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("AbsoluteMove")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_AbsoluteMove__1 AbsoluteMove { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (AbsoluteMove is null) + { + throw new ArgumentNullException("AbsoluteMove field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (AbsoluteMove is null) + { + throw new ArgumentNullException("AbsoluteMove field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveCommandExecutor.g.cs new file mode 100644 index 0000000..afdebfb --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'ContinuousMove'. + /// + public class ContinuousMoveCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal ContinuousMoveCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "ContinuousMove", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveCommandInvoker.g.cs new file mode 100644 index 0000000..e9400a9 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'ContinuousMove'. + /// + public class ContinuousMoveCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal ContinuousMoveCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "ContinuousMove", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveRequestPayload.g.cs new file mode 100644 index 0000000..924d3db --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/ContinuousMoveRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class ContinuousMoveRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("ContinuousMove")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_ContinuousMove__1 ContinuousMove { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (ContinuousMove is null) + { + throw new ArgumentNullException("ContinuousMove field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (ContinuousMove is null) + { + throw new ArgumentNullException("ContinuousMove field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_EFlipMode__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_EFlipMode__1.g.cs new file mode 100644 index 0000000..1056c2c --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_EFlipMode__1.g.cs @@ -0,0 +1,14 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + public enum Enum_Onvif_Ptz_EFlipMode__1 + { + Unknown = 0, + OFF = 1, + ON = 2, + Extended = 3, + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_MoveStatus__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_MoveStatus__1.g.cs new file mode 100644 index 0000000..bb609e4 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_MoveStatus__1.g.cs @@ -0,0 +1,13 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + public enum Enum_Onvif_Ptz_MoveStatus__1 + { + UNKNOWN = 0, + IDLE = 1, + MOVING = 2, + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_PTZPresetTourOperation__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_PTZPresetTourOperation__1.g.cs new file mode 100644 index 0000000..b285bf2 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_PTZPresetTourOperation__1.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + public enum Enum_Onvif_Ptz_PTZPresetTourOperation__1 + { + Unknown = 0, + Start = 1, + Stop = 2, + Pause = 3, + Extended = 4, + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_ReverseMode__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_ReverseMode__1.g.cs new file mode 100644 index 0000000..8e948d6 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Enum_Onvif_Ptz_ReverseMode__1.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + public enum Enum_Onvif_Ptz_ReverseMode__1 + { + Unknown = 0, + OFF = 1, + ON = 2, + AUTO = 3, + Extended = 4, + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationCommandExecutor.g.cs new file mode 100644 index 0000000..4c169e1 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GetConfiguration'. + /// + public class GetConfigurationCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GetConfigurationCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetConfiguration", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationCommandInvoker.g.cs new file mode 100644 index 0000000..f8ccab8 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GetConfiguration'. + /// + public class GetConfigurationCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GetConfigurationCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetConfiguration", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsCommandExecutor.g.cs new file mode 100644 index 0000000..b75ccb8 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GetConfigurationOptions'. + /// + public class GetConfigurationOptionsCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GetConfigurationOptionsCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetConfigurationOptions", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsCommandInvoker.g.cs new file mode 100644 index 0000000..1847721 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GetConfigurationOptions'. + /// + public class GetConfigurationOptionsCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GetConfigurationOptionsCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetConfigurationOptions", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsRequestPayload.g.cs new file mode 100644 index 0000000..a0aea43 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetConfigurationOptionsRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("GetConfigurationOptions")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GetConfigurationOptions__1 GetConfigurationOptions { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetConfigurationOptions is null) + { + throw new ArgumentNullException("GetConfigurationOptions field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetConfigurationOptions is null) + { + throw new ArgumentNullException("GetConfigurationOptions field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsResponsePayload.g.cs new file mode 100644 index 0000000..44a178d --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationOptionsResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetConfigurationOptionsResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("GetConfigurationOptionsResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GetConfigurationOptionsResponse__1 GetConfigurationOptionsResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetConfigurationOptionsResponse is null) + { + throw new ArgumentNullException("GetConfigurationOptionsResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetConfigurationOptionsResponse is null) + { + throw new ArgumentNullException("GetConfigurationOptionsResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationRequestPayload.g.cs new file mode 100644 index 0000000..b9e5c1b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetConfigurationRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("GetConfiguration")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GetConfiguration__1 GetConfiguration { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetConfiguration is null) + { + throw new ArgumentNullException("GetConfiguration field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetConfiguration is null) + { + throw new ArgumentNullException("GetConfiguration field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationResponsePayload.g.cs new file mode 100644 index 0000000..5bb2f06 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetConfigurationResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("GetConfigurationResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_PTZConfiguration__1 GetConfigurationResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetConfigurationResponse is null) + { + throw new ArgumentNullException("GetConfigurationResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetConfigurationResponse is null) + { + throw new ArgumentNullException("GetConfigurationResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsCommandExecutor.g.cs new file mode 100644 index 0000000..10afefc --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GetConfigurations'. + /// + public class GetConfigurationsCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GetConfigurationsCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetConfigurations", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsCommandInvoker.g.cs new file mode 100644 index 0000000..52ba8b5 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GetConfigurations'. + /// + public class GetConfigurationsCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GetConfigurationsCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetConfigurations", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsResponsePayload.g.cs new file mode 100644 index 0000000..4bac2b7 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetConfigurationsResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetConfigurationsResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("GetConfigurationsResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public List GetConfigurationsResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetConfigurationsResponse is null) + { + throw new ArgumentNullException("GetConfigurationsResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetConfigurationsResponse is null) + { + throw new ArgumentNullException("GetConfigurationsResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeCommandExecutor.g.cs new file mode 100644 index 0000000..09eb662 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GetNode'. + /// + public class GetNodeCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GetNodeCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetNode", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeCommandInvoker.g.cs new file mode 100644 index 0000000..a957301 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GetNode'. + /// + public class GetNodeCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GetNodeCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetNode", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeRequestPayload.g.cs new file mode 100644 index 0000000..0ce8f5e --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetNodeRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("GetNodeRequest")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GetNodeRequest__1 GetNodeRequest { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetNodeRequest is null) + { + throw new ArgumentNullException("GetNodeRequest field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetNodeRequest is null) + { + throw new ArgumentNullException("GetNodeRequest field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeResponsePayload.g.cs new file mode 100644 index 0000000..e19f0ec --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodeResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetNodeResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("GetNodeResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_PTZNode__1 GetNodeResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetNodeResponse is null) + { + throw new ArgumentNullException("GetNodeResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetNodeResponse is null) + { + throw new ArgumentNullException("GetNodeResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesCommandExecutor.g.cs new file mode 100644 index 0000000..4fa3bf6 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GetNodes'. + /// + public class GetNodesCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GetNodesCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetNodes", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesCommandInvoker.g.cs new file mode 100644 index 0000000..261bcd3 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GetNodes'. + /// + public class GetNodesCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GetNodesCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetNodes", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesResponsePayload.g.cs new file mode 100644 index 0000000..cc062ca --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetNodesResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetNodesResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("GetNodesResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public List GetNodesResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetNodesResponse is null) + { + throw new ArgumentNullException("GetNodesResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetNodesResponse is null) + { + throw new ArgumentNullException("GetNodesResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsCommandExecutor.g.cs new file mode 100644 index 0000000..ce455a4 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GetPresets'. + /// + public class GetPresetsCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GetPresetsCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetPresets", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsCommandInvoker.g.cs new file mode 100644 index 0000000..a20528f --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GetPresets'. + /// + public class GetPresetsCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GetPresetsCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetPresets", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsRequestPayload.g.cs new file mode 100644 index 0000000..4870728 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetPresetsRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("GetPresets")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GetPresets__1 GetPresets { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetPresets is null) + { + throw new ArgumentNullException("GetPresets field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetPresets is null) + { + throw new ArgumentNullException("GetPresets field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsResponsePayload.g.cs new file mode 100644 index 0000000..a43d5fd --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetPresetsResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetPresetsResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("GetPresetsResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GetPresetsResponse__1 GetPresetsResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetPresetsResponse is null) + { + throw new ArgumentNullException("GetPresetsResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetPresetsResponse is null) + { + throw new ArgumentNullException("GetPresetsResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusCommandExecutor.g.cs new file mode 100644 index 0000000..46c251d --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GetStatus'. + /// + public class GetStatusCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GetStatusCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetStatus", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusCommandInvoker.g.cs new file mode 100644 index 0000000..d1d8995 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GetStatus'. + /// + public class GetStatusCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GetStatusCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GetStatus", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusRequestPayload.g.cs new file mode 100644 index 0000000..efcfff4 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetStatusRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("GetStatusRequest")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GetStatus__1 GetStatusRequest { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetStatusRequest is null) + { + throw new ArgumentNullException("GetStatusRequest field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetStatusRequest is null) + { + throw new ArgumentNullException("GetStatusRequest field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusResponsePayload.g.cs new file mode 100644 index 0000000..866bbdc --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GetStatusResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GetStatusResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("GetStatusResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GetStatusResponse__1 GetStatusResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GetStatusResponse is null) + { + throw new ArgumentNullException("GetStatusResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GetStatusResponse is null) + { + throw new ArgumentNullException("GetStatusResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionCommandExecutor.g.cs new file mode 100644 index 0000000..ac48e82 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GotoHomePosition'. + /// + public class GotoHomePositionCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GotoHomePositionCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GotoHomePosition", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionCommandInvoker.g.cs new file mode 100644 index 0000000..20ff44c --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GotoHomePosition'. + /// + public class GotoHomePositionCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GotoHomePositionCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GotoHomePosition", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionRequestPayload.g.cs new file mode 100644 index 0000000..cea26c6 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoHomePositionRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GotoHomePositionRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("GotoHomePosition")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GotoHomePosition__1 GotoHomePosition { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GotoHomePosition is null) + { + throw new ArgumentNullException("GotoHomePosition field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GotoHomePosition is null) + { + throw new ArgumentNullException("GotoHomePosition field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetCommandExecutor.g.cs new file mode 100644 index 0000000..01cff7b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'GotoPreset'. + /// + public class GotoPresetCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal GotoPresetCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "GotoPreset", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetCommandInvoker.g.cs new file mode 100644 index 0000000..48a323a --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'GotoPreset'. + /// + public class GotoPresetCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal GotoPresetCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "GotoPreset", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetRequestPayload.g.cs new file mode 100644 index 0000000..ea2b5b8 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/GotoPresetRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class GotoPresetRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("GotoPreset")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_GotoPreset__1 GotoPreset { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (GotoPreset is null) + { + throw new ArgumentNullException("GotoPreset field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (GotoPreset is null) + { + throw new ArgumentNullException("GotoPreset field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_AbsoluteMove__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_AbsoluteMove__1.g.cs new file mode 100644 index 0000000..fbf1100 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_AbsoluteMove__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_AbsoluteMove__1 + { + /// + /// A Position vector specifying the absolute target position. + /// + [JsonPropertyName("Position")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZVector__1? Position { get; set; } = default; + + /// + /// A reference to the MediaProfile. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + /// + /// An optional Speed. + /// + [JsonPropertyName("Speed")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZSpeed__1? Speed { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_AuxiliaryData__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_AuxiliaryData__1.g.cs new file mode 100644 index 0000000..feba369 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_AuxiliaryData__1.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_AuxiliaryData__1 + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_ContinuousMove__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_ContinuousMove__1.g.cs new file mode 100644 index 0000000..539a91b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_ContinuousMove__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_ContinuousMove__1 + { + /// + /// A reference to the MediaProfile. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + /// + /// An optional Timeout parameter. + /// + [JsonPropertyName("Timeout")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public TimeSpan? Timeout { get; set; } = default; + + /// + /// A Velocity vector specifying the velocity of pan, tilt and zoom. + /// + [JsonPropertyName("Velocity")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZSpeed__1? Velocity { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationOptionsResponse__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationOptionsResponse__1.g.cs new file mode 100644 index 0000000..391c82e --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationOptionsResponse__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetConfigurationOptionsResponse__1 + { + /// + /// The PTZ Configuration Options. + /// + [JsonPropertyName("PTZConfigurationOptions")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZConfigurationOptions__1? PTZConfigurationOptions { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationOptions__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationOptions__1.g.cs new file mode 100644 index 0000000..b7dedcc --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationOptions__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetConfigurationOptions__1 + { + /// + /// Token of an existing configuration that the options are intended for. + /// + [JsonPropertyName("ConfigurationToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ConfigurationToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfiguration__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfiguration__1.g.cs new file mode 100644 index 0000000..99af3fe --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfiguration__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetConfiguration__1 + { + /// + /// Token of the requested PTZConfiguration. + /// + [JsonPropertyName("PTZConfigurationToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? PTZConfigurationToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationsResponse__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationsResponse__1.g.cs new file mode 100644 index 0000000..6d6d5a0 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetConfigurationsResponse__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetConfigurationsResponse__1 + { + /// + /// A list of all existing PTZConfigurations on the device. + /// + [JsonPropertyName("PTZConfiguration")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? PTZConfiguration { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetNodeRequest__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetNodeRequest__1.g.cs new file mode 100644 index 0000000..3cf6ec1 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetNodeRequest__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetNodeRequest__1 + { + /// + /// Token of the requested PTZNode. + /// + [JsonPropertyName("NodeToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? NodeToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetPresetsResponse__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetPresetsResponse__1.g.cs new file mode 100644 index 0000000..54f6401 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetPresetsResponse__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetPresetsResponse__1 + { + /// + /// A list of presets which are available for the requested MediaProfile. + /// + [JsonPropertyName("Presets")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? Presets { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetPresets__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetPresets__1.g.cs new file mode 100644 index 0000000..1ee69a9 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetPresets__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetPresets__1 + { + /// + /// A reference to the MediaProfile where the operation should take place. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetStatusResponse__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetStatusResponse__1.g.cs new file mode 100644 index 0000000..16327c6 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetStatusResponse__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetStatusResponse__1 + { + /// + /// The PTZStatus for the requested MediaProfile. + /// + [JsonPropertyName("PTZStatus")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZStatus__1? PTZStatus { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetStatus__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetStatus__1.g.cs new file mode 100644 index 0000000..0e28bd7 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GetStatus__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GetStatus__1 + { + /// + /// A reference to the MediaProfile where the PTZStatus should be requested. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GotoHomePosition__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GotoHomePosition__1.g.cs new file mode 100644 index 0000000..118bfb7 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GotoHomePosition__1.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GotoHomePosition__1 + { + /// + /// A reference to the MediaProfile where the operation should take place. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + /// + /// A requested speed.The speed parameter can only be specified when Speed Spaces are available for the PTZ Node. + /// + [JsonPropertyName("Speed")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZSpeed__1? Speed { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GotoPreset__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GotoPreset__1.g.cs new file mode 100644 index 0000000..f1f3d80 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_GotoPreset__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_GotoPreset__1 + { + /// + /// A requested preset token. + /// + [JsonPropertyName("PresetToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? PresetToken { get; set; } = default; + + /// + /// A reference to the MediaProfile where the operation should take place. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + /// + /// A requested speed.The speed parameter can only be specified when Speed Spaces are available for the PTZ Node. + /// + [JsonPropertyName("Speed")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZSpeed__1? Speed { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZConfigurationOptions__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZConfigurationOptions__1.g.cs new file mode 100644 index 0000000..d32fe30 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZConfigurationOptions__1.g.cs @@ -0,0 +1,50 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZConfigurationOptions__1 + { + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfigurationOptions_Extension? Extension { get; set; } = default; + + /// + /// Supported options for PT Direction Control. + /// + [JsonPropertyName("PTControlDirection")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfigurationOptions_PTControlDirection? PTControlDirection { get; set; } = default; + + /// + /// The list of acceleration ramps supported by the device. The smallest acceleration value corresponds to the minimal index, the highest acceleration corresponds to the maximum index. + /// + [JsonPropertyName("PTZRamps")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? PTZRamps { get; set; } = default; + + /// + /// A timeout Range within which Timeouts are accepted by the PTZ Node. + /// + [JsonPropertyName("PTZTimeout")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfigurationOptions_PTZTimeout? PTZTimeout { get; set; } = default; + + /// + /// A list of supported coordinate systems including their range limitations. + /// + [JsonPropertyName("Spaces")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZSpaces__1? Spaces { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZConfiguration__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZConfiguration__1.g.cs new file mode 100644 index 0000000..c55388e --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZConfiguration__1.g.cs @@ -0,0 +1,141 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZConfiguration__1 + { + /// + /// If the PTZ Node supports absolute Pan/Tilt movements, it shall specify one Absolute Pan/Tilt Position Space as default. + /// + [JsonPropertyName("DefaultAbsolutePantTiltPositionSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? DefaultAbsolutePantTiltPositionSpace { get; set; } = default; + + /// + /// If the PTZ Node supports absolute zoom movements, it shall specify one Absolute Zoom Position Space as default. + /// + [JsonPropertyName("DefaultAbsoluteZoomPositionSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? DefaultAbsoluteZoomPositionSpace { get; set; } = default; + + /// + /// If the PTZ Node supports continuous Pan/Tilt movements, it shall specify one Continuous Pan/Tilt Velocity Space as default. + /// + [JsonPropertyName("DefaultContinuousPanTiltVelocitySpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? DefaultContinuousPanTiltVelocitySpace { get; set; } = default; + + /// + /// If the PTZ Node supports continuous zoom movements, it shall specify one Continuous Zoom Velocity Space as default. + /// + [JsonPropertyName("DefaultContinuousZoomVelocitySpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? DefaultContinuousZoomVelocitySpace { get; set; } = default; + + /// + /// If the PTZ Node supports absolute or relative PTZ movements, it shall specify corresponding default Pan/Tilt and Zoom speeds. + /// + [JsonPropertyName("DefaultPTZSpeed")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZSpeed__1? DefaultPTZSpeed { get; set; } = default; + + /// + /// If the PTZ Node supports continuous movements, it shall specify a default timeout, after which the movement stops. + /// + [JsonPropertyName("DefaultPTZTimeout")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public TimeSpan? DefaultPTZTimeout { get; set; } = default; + + /// + /// If the PTZ Node supports relative Pan/Tilt movements, it shall specify one RelativePan/Tilt Translation Space as default. + /// + [JsonPropertyName("DefaultRelativePanTiltTranslationSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? DefaultRelativePanTiltTranslationSpace { get; set; } = default; + + /// + /// If the PTZ Node supports relative zoom movements, it shall specify one Relative Zoom Translation Space as default. + /// + [JsonPropertyName("DefaultRelativeZoomTranslationSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? DefaultRelativeZoomTranslationSpace { get; set; } = default; + + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfiguration_Extension? Extension { get; set; } = default; + + /// + /// The optional acceleration ramp used by the device when moving. + /// + [JsonPropertyName("MoveRamp")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public int? MoveRamp { get; set; } = default; + + /// + /// User readable name. Length up to 64 characters. + /// + [JsonPropertyName("Name")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Name { get; set; } = default; + + /// + /// A mandatory reference to the PTZ Node that the PTZ Configuration belongs to. + /// + [JsonPropertyName("NodeToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? NodeToken { get; set; } = default; + + /// + /// The Pan/Tilt limits element should be present for a PTZ Node that supports an absolute Pan/Tilt. If the element is present it signals the support for configurable Pan/Tilt limits. If limits are enabled, the Pan/Tilt movements shall always stay within the specified range. The Pan/Tilt limits are disabled by setting the limits to –INF or +INF. + /// + [JsonPropertyName("PanTiltLimits")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfiguration_PanTiltLimits? PanTiltLimits { get; set; } = default; + + /// + /// The optional acceleration ramp used by the device when recalling presets. + /// + [JsonPropertyName("PresetRamp")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public int? PresetRamp { get; set; } = default; + + /// + /// The optional acceleration ramp used by the device when executing PresetTours. + /// + [JsonPropertyName("PresetTourRamp")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public int? PresetTourRamp { get; set; } = default; + + /// + /// Token that uniquely references this configuration. Length up to 64 characters. + /// + [JsonPropertyName("token")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Token { get; set; } = default; + + /// + /// Number of internal references currently using this configuration. This informational parameter is read-only. Deprecated for Media2 Service. + /// + [JsonPropertyName("UseCount")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public int? UseCount { get; set; } = default; + + /// + /// The Zoom limits element should be present for a PTZ Node that supports absolute zoom. If the element is present it signals the supports for configurable Zoom limits. If limits are enabled the zoom movements shall always stay within the specified range. The Zoom limits are disabled by settings the limits to -INF and +INF. + /// + [JsonPropertyName("ZoomLimits")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfiguration_ZoomLimits? ZoomLimits { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNodeExtension2__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNodeExtension2__1.g.cs new file mode 100644 index 0000000..a2384b7 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNodeExtension2__1.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZNodeExtension2__1 + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNodeExtension__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNodeExtension__1.g.cs new file mode 100644 index 0000000..6e32514 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNodeExtension__1.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZNodeExtension__1 + { + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZNodeExtension2__1? Extension { get; set; } = default; + + /// + /// Detail of supported Preset Tour feature. + /// + [JsonPropertyName("SupportedPresetTour")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZPresetTourSupported__1? SupportedPresetTour { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNode__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNode__1.g.cs new file mode 100644 index 0000000..ca4a146 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZNode__1.g.cs @@ -0,0 +1,78 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZNode__1 + { + /// + /// A list of supported Auxiliary commands. If the list is not empty, the Auxiliary Operations MUST be available for this PTZ Node. + /// + [JsonPropertyName("AuxiliaryCommands")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? AuxiliaryCommands { get; set; } = default; + + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZNodeExtension__1? Extension { get; set; } = default; + + /// + /// Indication whether the HomePosition of a Node is fixed or it can be changed via the SetHomePosition command. + /// + [JsonPropertyName("FixedHomePosition")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool? FixedHomePosition { get; set; } = default; + + /// + /// Indication whether the Node supports the geo-referenced move command. + /// + [JsonPropertyName("GeoMove")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool? GeoMove { get; set; } = default; + + /// + /// A boolean operator specifying the availability of a home position. If set to true, the Home Position Operations MUST be available for this PTZ Node. + /// + [JsonPropertyName("HomeSupported")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool? HomeSupported { get; set; } = default; + + /// + /// All preset operations MUST be available for this PTZ Node if one preset is supported. + /// + [JsonPropertyName("MaximumNumberOfPresets")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public int? MaximumNumberOfPresets { get; set; } = default; + + /// + /// A unique identifier that is used to reference PTZ Nodes. + /// + [JsonPropertyName("Name")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Name { get; set; } = default; + + /// + /// A list of Coordinate Systems available for the PTZ Node. For each Coordinate System, the PTZ Node MUST specify its allowed range. + /// + [JsonPropertyName("SupportedPTZSpaces")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZSpaces__1? SupportedPTZSpaces { get; set; } = default; + + /// + /// Unique identifier referencing the physical entity. + /// + [JsonPropertyName("token")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Token { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPresetTourSupportedExtension__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPresetTourSupportedExtension__1.g.cs new file mode 100644 index 0000000..02aea3e --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPresetTourSupportedExtension__1.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZPresetTourSupportedExtension__1 + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPresetTourSupported__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPresetTourSupported__1.g.cs new file mode 100644 index 0000000..2eb91ff --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPresetTourSupported__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZPresetTourSupported__1 + { + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZPresetTourSupportedExtension__1? Extension { get; set; } = default; + + /// + /// Indicates number of preset tours that can be created. Required preset tour operations shall be available for this PTZ Node if one or more preset tour is supported. + /// + [JsonPropertyName("MaximumNumberOfPresetTours")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public int? MaximumNumberOfPresetTours { get; set; } = default; + + /// + /// Indicates which preset tour operations are available for this PTZ Node. + /// + [JsonPropertyName("PTZPresetTourOperation")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? PTZPresetTourOperation { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPreset__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPreset__1.g.cs new file mode 100644 index 0000000..5159778 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZPreset__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZPreset__1 + { + /// + /// User readable name. Length up to 64 characters. + /// + [JsonPropertyName("Name")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Name { get; set; } = default; + + /// + /// The PTZPosition of the preset. + /// + [JsonPropertyName("PTZPosition")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZVector__1? PTZPosition { get; set; } = default; + + /// + /// Token that uniquely references this preset. + /// + [JsonPropertyName("token")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Token { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZSpaces__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZSpaces__1.g.cs new file mode 100644 index 0000000..a9e4ddb --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZSpaces__1.g.cs @@ -0,0 +1,71 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZSpaces__1 + { + /// + /// The Generic Pan/Tilt Position space is provided by every PTZ node that supports absolute Pan/Tilt, since it does not relate to a specific physical range. Instead, the range should be defined as the full range of the PTZ unit normalized to the range -1 to 1 resulting in the following space description. + /// + [JsonPropertyName("AbsolutePanTiltPositionSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? AbsolutePanTiltPositionSpace { get; set; } = default; + + /// + /// The Generic Zoom Position Space is provided by every PTZ node that supports absolute Zoom, since it does not relate to a specific physical range. Instead, the range should be defined as the full range of the Zoom normalized to the range 0 (wide) to 1 (tele). There is no assumption about how the generic zoom range is mapped to magnification, FOV or other physical zoom dimension. + /// + [JsonPropertyName("AbsoluteZoomPositionSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? AbsoluteZoomPositionSpace { get; set; } = default; + + /// + /// The generic zoom velocity space specifies a zoom factor velocity without knowing the underlying physical model. The range should be normalized from -1 to 1, where a positive velocity would map to TELE direction. A generic zoom velocity space description resembles the following. + /// + [JsonPropertyName("ContinuousPanTiltVelocitySpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? ContinuousPanTiltVelocitySpace { get; set; } = default; + + /// + /// The generic Pan/Tilt velocity space shall be provided by every PTZ node, since it does not relate to a specific physical range. Instead, the range should be defined as a range of the PTZ unit’s speed normalized to the range -1 to 1, where a positive velocity would map to clockwise rotation or movement in the right/up direction. A signed speed can be independently specified for the pan and tilt component resulting in the following space description. + /// + [JsonPropertyName("ContinuousZoomVelocitySpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? ContinuousZoomVelocitySpace { get; set; } = default; + + /// + /// The speed space specifies the speed for a Pan/Tilt movement when moving to an absolute position or to a relative translation. In contrast to the velocity spaces, speed spaces do not contain any directional information. The speed of a combined Pan/Tilt movement is represented by a single non-negative scalar value. + /// + [JsonPropertyName("PanTiltSpeedSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? PanTiltSpeedSpace { get; set; } = default; + + /// + /// The Generic Pan/Tilt translation space is provided by every PTZ node that supports relative Pan/Tilt, since it does not relate to a specific physical range. Instead, the range should be defined as the full positive and negative translation range of the PTZ unit normalized to the range -1 to 1, where positive translation would mean clockwise rotation or movement in right/up direction resulting in the following space description. + /// + [JsonPropertyName("RelativePanTiltTranslationSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? RelativePanTiltTranslationSpace { get; set; } = default; + + /// + /// The Generic Zoom Translation Space is provided by every PTZ node that supports relative Zoom, since it does not relate to a specific physical range. Instead, the corresponding absolute range should be defined as the full positive and negative translation range of the Zoom normalized to the range -1 to1, where a positive translation maps to a movement in TELE direction. The translation is signed to indicate direction (negative is to wide, positive is to tele). + /// + [JsonPropertyName("RelativeZoomTranslationSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? RelativeZoomTranslationSpace { get; set; } = default; + + /// + /// The speed space specifies the speed for a Zoom movement when moving to an absolute position or to a relative translation. In contrast to the velocity spaces, speed spaces do not contain any directional information. + /// + [JsonPropertyName("ZoomSpeedSpace")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? ZoomSpeedSpace { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZSpeed__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZSpeed__1.g.cs new file mode 100644 index 0000000..d4b5437 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZSpeed__1.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZSpeed__1 + { + /// + /// Pan and tilt speed. The x component corresponds to pan and the y component to tilt. If omitted in a request, the current (if any) PanTilt movement should not be affected. + /// + [JsonPropertyName("PanTilt")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_Vector2D__1? PanTilt { get; set; } = default; + + /// + /// A zoom speed. If omitted in a request, the current (if any) Zoom movement should not be affected. + /// + [JsonPropertyName("Zoom")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_Vector1D__1? Zoom { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZStatus__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZStatus__1.g.cs new file mode 100644 index 0000000..9df5b5b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZStatus__1.g.cs @@ -0,0 +1,43 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZStatus__1 + { + /// + /// States a current PTZ error. + /// + [JsonPropertyName("Error")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Error { get; set; } = default; + + /// + /// Indicates if the Pan/Tilt/Zoom device unit is currently moving, idle or in an unknown state. + /// + [JsonPropertyName("MoveStatus")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZStatus_MoveStatus? MoveStatus { get; set; } = default; + + /// + /// Specifies the absolute position of the PTZ unit together with the Space references. The default absolute spaces of the corresponding PTZ configuration MUST be referenced within the Position element. + /// + [JsonPropertyName("Position")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZVector__1? Position { get; set; } = default; + + /// + /// Specifies the UTC time when this status was generated. + /// + [JsonPropertyName("UtcTime")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public DateTime? UtcTime { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZVector__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZVector__1.g.cs new file mode 100644 index 0000000..6ce39c4 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_PTZVector__1.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_PTZVector__1 + { + /// + /// Pan and tilt position. The x component corresponds to pan and the y component to tilt. + /// + [JsonPropertyName("PanTilt")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_Vector2D__1? PanTilt { get; set; } = default; + + /// + /// A zoom position. + /// + [JsonPropertyName("Zoom")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_Vector1D__1? Zoom { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_RelativeMove__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_RelativeMove__1.g.cs new file mode 100644 index 0000000..54b766b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_RelativeMove__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_RelativeMove__1 + { + /// + /// A reference to the MediaProfile. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + /// + /// An optional Speed. + /// + [JsonPropertyName("Speed")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZSpeed__1? Speed { get; set; } = default; + + /// + /// A positional Translation relative to the current position + /// + [JsonPropertyName("Translation")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZVector__1? Translation { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_RemovePreset__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_RemovePreset__1.g.cs new file mode 100644 index 0000000..74d9045 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_RemovePreset__1.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_RemovePreset__1 + { + /// + /// A requested preset token. + /// + [JsonPropertyName("PresetToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? PresetToken { get; set; } = default; + + /// + /// A reference to the MediaProfile where the operation should take place. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SendAuxiliaryCommandResponse__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SendAuxiliaryCommandResponse__1.g.cs new file mode 100644 index 0000000..672a34b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SendAuxiliaryCommandResponse__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_SendAuxiliaryCommandResponse__1 + { + /// + /// The response contains the auxiliary response. + /// + [JsonPropertyName("AuxiliaryResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? AuxiliaryResponse { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SendAuxiliaryCommand__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SendAuxiliaryCommand__1.g.cs new file mode 100644 index 0000000..acbde20 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SendAuxiliaryCommand__1.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_SendAuxiliaryCommand__1 + { + /// + /// The Auxiliary request data. + /// + [JsonPropertyName("AuxiliaryData")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? AuxiliaryData { get; set; } = default; + + /// + /// A reference to the MediaProfile where the operation should take place. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetConfiguration__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetConfiguration__1.g.cs new file mode 100644 index 0000000..a20fe35 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetConfiguration__1.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_SetConfiguration__1 + { + /// + /// Flag that makes configuration persistent. Example: User wants the configuration to exist after reboot. + /// + [JsonPropertyName("ForcePersistence")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool? ForcePersistence { get; set; } = default; + + /// + /// The 'PTZConfiguration' Field. + /// + [JsonPropertyName("PTZConfiguration")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_PTZConfiguration__1? PTZConfiguration { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetHomePosition__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetHomePosition__1.g.cs new file mode 100644 index 0000000..ae258f9 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetHomePosition__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_SetHomePosition__1 + { + /// + /// A reference to the MediaProfile where the home position should be set. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetPresetResponse__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetPresetResponse__1.g.cs new file mode 100644 index 0000000..e42a99a --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetPresetResponse__1.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_SetPresetResponse__1 + { + /// + /// A token to the Preset which has been set. + /// + [JsonPropertyName("PresetToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? PresetToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetPreset__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetPreset__1.g.cs new file mode 100644 index 0000000..2a0e835 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_SetPreset__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_SetPreset__1 + { + /// + /// A requested preset name. + /// + [JsonPropertyName("PresetName")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? PresetName { get; set; } = default; + + /// + /// A requested preset token. + /// + [JsonPropertyName("PresetToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? PresetToken { get; set; } = default; + + /// + /// A reference to the MediaProfile where the operation should take place. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Space1DDescription__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Space1DDescription__1.g.cs new file mode 100644 index 0000000..93b7b9a --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Space1DDescription__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_Space1DDescription__1 + { + /// + /// A URI of coordinate systems. + /// + [JsonPropertyName("URI")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? URI { get; set; } = default; + + /// + /// The 'XRange__Max' Field. + /// + [JsonPropertyName("XRange__Max")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? XRange__Max { get; set; } = default; + + /// + /// The 'XRange__Min' Field. + /// + [JsonPropertyName("XRange__Min")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? XRange__Min { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Space2DDescription__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Space2DDescription__1.g.cs new file mode 100644 index 0000000..6e168ff --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Space2DDescription__1.g.cs @@ -0,0 +1,50 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_Space2DDescription__1 + { + /// + /// A URI of coordinate systems. + /// + [JsonPropertyName("URI")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? URI { get; set; } = default; + + /// + /// The 'XRange__Max' Field. + /// + [JsonPropertyName("XRange__Max")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? XRange__Max { get; set; } = default; + + /// + /// The 'XRange__Min' Field. + /// + [JsonPropertyName("XRange__Min")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? XRange__Min { get; set; } = default; + + /// + /// The 'YRange__Max' Field. + /// + [JsonPropertyName("YRange__Max")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? YRange__Max { get; set; } = default; + + /// + /// The 'YRange__Min' Field. + /// + [JsonPropertyName("YRange__Min")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? YRange__Min { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Stop__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Stop__1.g.cs new file mode 100644 index 0000000..053e961 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Stop__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_Stop__1 + { + /// + /// Set true when we want to stop ongoing pan and tilt movements.If PanTilt arguments are not present, this command stops these movements. + /// + [JsonPropertyName("PanTilt")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool? PanTilt { get; set; } = default; + + /// + /// A reference to the MediaProfile that indicate what should be stopped. + /// + [JsonPropertyName("ProfileToken")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? ProfileToken { get; set; } = default; + + /// + /// Set true when we want to stop ongoing zoom movement.If Zoom arguments are not present, this command stops ongoing zoom movement. + /// + [JsonPropertyName("Zoom")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool? Zoom { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Vector1D__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Vector1D__1.g.cs new file mode 100644 index 0000000..fcc2922 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Vector1D__1.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_Vector1D__1 + { + /// + /// The 'space' Field. + /// + [JsonPropertyName("space")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Space { get; set; } = default; + + /// + /// The 'x' Field. + /// + [JsonPropertyName("x")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? X { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Vector2D__1.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Vector2D__1.g.cs new file mode 100644 index 0000000..7b47066 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_Onvif_Ptz_Vector2D__1.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_Onvif_Ptz_Vector2D__1 + { + /// + /// The 'space' Field. + /// + [JsonPropertyName("space")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string? Space { get; set; } = default; + + /// + /// The 'x' Field. + /// + [JsonPropertyName("x")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? X { get; set; } = default; + + /// + /// The 'y' Field. + /// + [JsonPropertyName("y")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public float? Y { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_Extension.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_Extension.g.cs new file mode 100644 index 0000000..004b8ea --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_Extension.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfigurationOptions_Extension + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection.g.cs new file mode 100644 index 0000000..ef5d10b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection.g.cs @@ -0,0 +1,36 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfigurationOptions_PTControlDirection + { + /// + /// Supported options for EFlip feature. + /// + [JsonPropertyName("EFlip")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfigurationOptions_PTControlDirection_EFlip? EFlip { get; set; } = default; + + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfigurationOptions_PTControlDirection_Extension? Extension { get; set; } = default; + + /// + /// Supported options for Reverse feature. + /// + [JsonPropertyName("Reverse")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfigurationOptions_PTControlDirection_Reverse? Reverse { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_EFlip.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_EFlip.g.cs new file mode 100644 index 0000000..969c009 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_EFlip.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfigurationOptions_PTControlDirection_EFlip + { + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfigurationOptions_PTControlDirection_EFlip_Extension? Extension { get; set; } = default; + + /// + /// Options of EFlip mode parameter. + /// + [JsonPropertyName("Mode")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? Mode { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_EFlip_Extension.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_EFlip_Extension.g.cs new file mode 100644 index 0000000..a83b630 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_EFlip_Extension.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfigurationOptions_PTControlDirection_EFlip_Extension + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Extension.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Extension.g.cs new file mode 100644 index 0000000..1227250 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Extension.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfigurationOptions_PTControlDirection_Extension + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Reverse.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Reverse.g.cs new file mode 100644 index 0000000..b26e416 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Reverse.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfigurationOptions_PTControlDirection_Reverse + { + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfigurationOptions_PTControlDirection_Reverse_Extension? Extension { get; set; } = default; + + /// + /// Options of Reverse mode parameter. + /// + [JsonPropertyName("Mode")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public List? Mode { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Reverse_Extension.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Reverse_Extension.g.cs new file mode 100644 index 0000000..e00946b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTControlDirection_Reverse_Extension.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfigurationOptions_PTControlDirection_Reverse_Extension + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTZTimeout.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTZTimeout.g.cs new file mode 100644 index 0000000..517ae68 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfigurationOptions_PTZTimeout.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfigurationOptions_PTZTimeout + { + /// + /// The 'Max' Field. + /// + [JsonPropertyName("Max")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public TimeSpan? Max { get; set; } = default; + + /// + /// The 'Min' Field. + /// + [JsonPropertyName("Min")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public TimeSpan? Min { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension.g.cs new file mode 100644 index 0000000..a91a643 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfiguration_Extension + { + /// + /// The 'Extension' Field. + /// + [JsonPropertyName("Extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfiguration_Extension_Extension? Extension { get; set; } = default; + + /// + /// Optional element to configure PT Control Direction related features. + /// + [JsonPropertyName("PTControlDirection")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_PTZConfiguration_Extension_PTControlDirection? PTControlDirection { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension_Extension.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension_Extension.g.cs new file mode 100644 index 0000000..9534edf --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension_Extension.g.cs @@ -0,0 +1,15 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfiguration_Extension_Extension + { + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension_PTControlDirection.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension_PTControlDirection.g.cs new file mode 100644 index 0000000..d517e69 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_Extension_PTControlDirection.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfiguration_Extension_PTControlDirection + { + /// + /// Optional element to configure related parameters for E-Flip. + /// + [JsonPropertyName("EFlip_mode")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Enum_Onvif_Ptz_EFlipMode__1? EFlip_mode { get; set; } = default; + + /// + /// Optional element to configure related parameters for reversing of PT Control Direction. + /// + [JsonPropertyName("Reverse_Mode")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Enum_Onvif_Ptz_ReverseMode__1? Reverse_Mode { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_PanTiltLimits.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_PanTiltLimits.g.cs new file mode 100644 index 0000000..84387ae --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_PanTiltLimits.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfiguration_PanTiltLimits + { + /// + /// A range of pan tilt limits. + /// + [JsonPropertyName("Range")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_Space2DDescription__1? Range { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_ZoomLimits.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_ZoomLimits.g.cs new file mode 100644 index 0000000..82d99cf --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZConfiguration_ZoomLimits.g.cs @@ -0,0 +1,22 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZConfiguration_ZoomLimits + { + /// + /// A range of zoom limit + /// + [JsonPropertyName("Range")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Object_Onvif_Ptz_Space1DDescription__1? Range { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZStatus_MoveStatus.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZStatus_MoveStatus.g.cs new file mode 100644 index 0000000..52c9315 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Object_PTZStatus_MoveStatus.g.cs @@ -0,0 +1,29 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class Object_PTZStatus_MoveStatus + { + /// + /// The 'PanTilt' Field. + /// + [JsonPropertyName("PanTilt")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Enum_Onvif_Ptz_MoveStatus__1? PanTilt { get; set; } = default; + + /// + /// The 'Zoom' Field. + /// + [JsonPropertyName("Zoom")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public Enum_Onvif_Ptz_MoveStatus__1? Zoom { get; set; } = default; + + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Ptz.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Ptz.g.cs new file mode 100644 index 0000000..5265eac --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/Ptz.g.cs @@ -0,0 +1,525 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading; + using System.Threading.Tasks; + using Azure.Iot.Operations.Protocol.Models; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Telemetry; + using PTZ; + + [ModelId("dtmi:onvif:ptz;1")] + [CommandTopic("{ex:namespace}/mrpc/{ex:asset}/{commandName}")] + [ServiceGroupId("MyServiceGroup")] + public static partial class Ptz + { + public abstract partial class Service : IAsyncDisposable + { + private readonly GetNodesCommandExecutor getNodesCommandExecutor; + private readonly GetNodeCommandExecutor getNodeCommandExecutor; + private readonly AbsoluteMoveCommandExecutor absoluteMoveCommandExecutor; + private readonly RelativeMoveCommandExecutor relativeMoveCommandExecutor; + private readonly ContinuousMoveCommandExecutor continuousMoveCommandExecutor; + private readonly StopCommandExecutor stopCommandExecutor; + private readonly GetConfigurationsCommandExecutor getConfigurationsCommandExecutor; + private readonly GetConfigurationCommandExecutor getConfigurationCommandExecutor; + private readonly GetConfigurationOptionsCommandExecutor getConfigurationOptionsCommandExecutor; + private readonly SetConfigurationCommandExecutor setConfigurationCommandExecutor; + private readonly GetStatusCommandExecutor getStatusCommandExecutor; + private readonly GetPresetsCommandExecutor getPresetsCommandExecutor; + private readonly SetPresetCommandExecutor setPresetCommandExecutor; + private readonly RemovePresetCommandExecutor removePresetCommandExecutor; + private readonly GotoPresetCommandExecutor gotoPresetCommandExecutor; + private readonly GotoHomePositionCommandExecutor gotoHomePositionCommandExecutor; + private readonly SetHomePositionCommandExecutor setHomePositionCommandExecutor; + private readonly SendAuxiliaryCommandCommandExecutor sendAuxiliaryCommandCommandExecutor; + + public Service(IMqttPubSubClient mqttClient) + { + this.CustomTopicTokenMap = new(); + + this.getNodesCommandExecutor = new GetNodesCommandExecutor(mqttClient) { OnCommandReceived = GetNodes_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getNodeCommandExecutor = new GetNodeCommandExecutor(mqttClient) { OnCommandReceived = GetNode_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.absoluteMoveCommandExecutor = new AbsoluteMoveCommandExecutor(mqttClient) { OnCommandReceived = AbsoluteMove_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.relativeMoveCommandExecutor = new RelativeMoveCommandExecutor(mqttClient) { OnCommandReceived = RelativeMove_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.continuousMoveCommandExecutor = new ContinuousMoveCommandExecutor(mqttClient) { OnCommandReceived = ContinuousMove_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.stopCommandExecutor = new StopCommandExecutor(mqttClient) { OnCommandReceived = Stop_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getConfigurationsCommandExecutor = new GetConfigurationsCommandExecutor(mqttClient) { OnCommandReceived = GetConfigurations_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getConfigurationCommandExecutor = new GetConfigurationCommandExecutor(mqttClient) { OnCommandReceived = GetConfiguration_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getConfigurationOptionsCommandExecutor = new GetConfigurationOptionsCommandExecutor(mqttClient) { OnCommandReceived = GetConfigurationOptions_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.setConfigurationCommandExecutor = new SetConfigurationCommandExecutor(mqttClient) { OnCommandReceived = SetConfiguration_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getStatusCommandExecutor = new GetStatusCommandExecutor(mqttClient) { OnCommandReceived = GetStatus_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getPresetsCommandExecutor = new GetPresetsCommandExecutor(mqttClient) { OnCommandReceived = GetPresets_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.setPresetCommandExecutor = new SetPresetCommandExecutor(mqttClient) { OnCommandReceived = SetPreset_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.removePresetCommandExecutor = new RemovePresetCommandExecutor(mqttClient) { OnCommandReceived = RemovePreset_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.gotoPresetCommandExecutor = new GotoPresetCommandExecutor(mqttClient) { OnCommandReceived = GotoPreset_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.gotoHomePositionCommandExecutor = new GotoHomePositionCommandExecutor(mqttClient) { OnCommandReceived = GotoHomePosition_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.setHomePositionCommandExecutor = new SetHomePositionCommandExecutor(mqttClient) { OnCommandReceived = SetHomePosition_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.sendAuxiliaryCommandCommandExecutor = new SendAuxiliaryCommandCommandExecutor(mqttClient) { OnCommandReceived = SendAuxiliaryCommand_Int, CustomTopicTokenMap = this.CustomTopicTokenMap }; + } + + public GetNodesCommandExecutor GetNodesCommandExecutor { get => this.getNodesCommandExecutor; } + public GetNodeCommandExecutor GetNodeCommandExecutor { get => this.getNodeCommandExecutor; } + public AbsoluteMoveCommandExecutor AbsoluteMoveCommandExecutor { get => this.absoluteMoveCommandExecutor; } + public RelativeMoveCommandExecutor RelativeMoveCommandExecutor { get => this.relativeMoveCommandExecutor; } + public ContinuousMoveCommandExecutor ContinuousMoveCommandExecutor { get => this.continuousMoveCommandExecutor; } + public StopCommandExecutor StopCommandExecutor { get => this.stopCommandExecutor; } + public GetConfigurationsCommandExecutor GetConfigurationsCommandExecutor { get => this.getConfigurationsCommandExecutor; } + public GetConfigurationCommandExecutor GetConfigurationCommandExecutor { get => this.getConfigurationCommandExecutor; } + public GetConfigurationOptionsCommandExecutor GetConfigurationOptionsCommandExecutor { get => this.getConfigurationOptionsCommandExecutor; } + public SetConfigurationCommandExecutor SetConfigurationCommandExecutor { get => this.setConfigurationCommandExecutor; } + public GetStatusCommandExecutor GetStatusCommandExecutor { get => this.getStatusCommandExecutor; } + public GetPresetsCommandExecutor GetPresetsCommandExecutor { get => this.getPresetsCommandExecutor; } + public SetPresetCommandExecutor SetPresetCommandExecutor { get => this.setPresetCommandExecutor; } + public RemovePresetCommandExecutor RemovePresetCommandExecutor { get => this.removePresetCommandExecutor; } + public GotoPresetCommandExecutor GotoPresetCommandExecutor { get => this.gotoPresetCommandExecutor; } + public GotoHomePositionCommandExecutor GotoHomePositionCommandExecutor { get => this.gotoHomePositionCommandExecutor; } + public SetHomePositionCommandExecutor SetHomePositionCommandExecutor { get => this.setHomePositionCommandExecutor; } + public SendAuxiliaryCommandCommandExecutor SendAuxiliaryCommandCommandExecutor { get => this.sendAuxiliaryCommandCommandExecutor; } + + public Dictionary CustomTopicTokenMap { get; private init; } + + public abstract Task> GetNodesAsync(CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task> GetNodeAsync(GetNodeRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task AbsoluteMoveAsync(AbsoluteMoveRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task RelativeMoveAsync(RelativeMoveRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task ContinuousMoveAsync(ContinuousMoveRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task StopAsync(StopRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task> GetConfigurationsAsync(CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task> GetConfigurationAsync(GetConfigurationRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task> GetConfigurationOptionsAsync(GetConfigurationOptionsRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task SetConfigurationAsync(SetConfigurationRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task> GetStatusAsync(GetStatusRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task> GetPresetsAsync(GetPresetsRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task> SetPresetAsync(SetPresetRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task RemovePresetAsync(RemovePresetRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task GotoPresetAsync(GotoPresetRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task GotoHomePositionAsync(GotoHomePositionRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task SetHomePositionAsync(SetHomePositionRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public abstract Task> SendAuxiliaryCommandAsync(SendAuxiliaryCommandRequestPayload request, CommandRequestMetadata requestMetadata, CancellationToken cancellationToken); + + public async Task StartAsync(int? preferredDispatchConcurrency = null, CancellationToken cancellationToken = default) + { + await Task.WhenAll( + this.getNodesCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.getNodeCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.absoluteMoveCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.relativeMoveCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.continuousMoveCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.stopCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.getConfigurationsCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.getConfigurationCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.getConfigurationOptionsCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.setConfigurationCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.getStatusCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.getPresetsCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.setPresetCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.removePresetCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.gotoPresetCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.gotoHomePositionCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.setHomePositionCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken), + this.sendAuxiliaryCommandCommandExecutor.StartAsync(preferredDispatchConcurrency, cancellationToken)).ConfigureAwait(false); + } + + public async Task StopAsync(CancellationToken cancellationToken = default) + { + await Task.WhenAll( + this.getNodesCommandExecutor.StopAsync(cancellationToken), + this.getNodeCommandExecutor.StopAsync(cancellationToken), + this.absoluteMoveCommandExecutor.StopAsync(cancellationToken), + this.relativeMoveCommandExecutor.StopAsync(cancellationToken), + this.continuousMoveCommandExecutor.StopAsync(cancellationToken), + this.stopCommandExecutor.StopAsync(cancellationToken), + this.getConfigurationsCommandExecutor.StopAsync(cancellationToken), + this.getConfigurationCommandExecutor.StopAsync(cancellationToken), + this.getConfigurationOptionsCommandExecutor.StopAsync(cancellationToken), + this.setConfigurationCommandExecutor.StopAsync(cancellationToken), + this.getStatusCommandExecutor.StopAsync(cancellationToken), + this.getPresetsCommandExecutor.StopAsync(cancellationToken), + this.setPresetCommandExecutor.StopAsync(cancellationToken), + this.removePresetCommandExecutor.StopAsync(cancellationToken), + this.gotoPresetCommandExecutor.StopAsync(cancellationToken), + this.gotoHomePositionCommandExecutor.StopAsync(cancellationToken), + this.setHomePositionCommandExecutor.StopAsync(cancellationToken), + this.sendAuxiliaryCommandCommandExecutor.StopAsync(cancellationToken)).ConfigureAwait(false); + } + private async Task> GetNodes_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.GetNodesAsync(req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + private async Task> GetNode_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.GetNodeAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + private async Task> AbsoluteMove_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.AbsoluteMoveAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> RelativeMove_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.RelativeMoveAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> ContinuousMove_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.ContinuousMoveAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> Stop_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.StopAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> GetConfigurations_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.GetConfigurationsAsync(req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + private async Task> GetConfiguration_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.GetConfigurationAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + private async Task> GetConfigurationOptions_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.GetConfigurationOptionsAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + private async Task> SetConfiguration_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.SetConfigurationAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> GetStatus_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.GetStatusAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + private async Task> GetPresets_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.GetPresetsAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + private async Task> SetPreset_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.SetPresetAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + private async Task> RemovePreset_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.RemovePresetAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> GotoPreset_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.GotoPresetAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> GotoHomePosition_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.GotoHomePositionAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> SetHomePosition_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + CommandResponseMetadata? responseMetadata = await this.SetHomePositionAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { ResponseMetadata = responseMetadata }; + } + private async Task> SendAuxiliaryCommand_Int(ExtendedRequest req, CancellationToken cancellationToken) + { + ExtendedResponse extended = await this.SendAuxiliaryCommandAsync(req.Request!, req.RequestMetadata!, cancellationToken); + return new ExtendedResponse { Response = extended.Response, ResponseMetadata = extended.ResponseMetadata }; + } + + public async ValueTask DisposeAsync() + { + await this.getNodesCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.getNodeCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.absoluteMoveCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.relativeMoveCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.continuousMoveCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.stopCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.getConfigurationsCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.getConfigurationCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.getConfigurationOptionsCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.setConfigurationCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.getStatusCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.getPresetsCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.setPresetCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.removePresetCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.gotoPresetCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.gotoHomePositionCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.setHomePositionCommandExecutor.DisposeAsync().ConfigureAwait(false); + await this.sendAuxiliaryCommandCommandExecutor.DisposeAsync().ConfigureAwait(false); + } + + public async ValueTask DisposeAsync(bool disposing) + { + await this.getNodesCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.getNodeCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.absoluteMoveCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.relativeMoveCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.continuousMoveCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.stopCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.getConfigurationsCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.getConfigurationCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.getConfigurationOptionsCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.setConfigurationCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.getStatusCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.getPresetsCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.setPresetCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.removePresetCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.gotoPresetCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.gotoHomePositionCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.setHomePositionCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + await this.sendAuxiliaryCommandCommandExecutor.DisposeAsync(disposing).ConfigureAwait(false); + } + } + + public abstract partial class Client : IAsyncDisposable + { + private readonly GetNodesCommandInvoker getNodesCommandInvoker; + private readonly GetNodeCommandInvoker getNodeCommandInvoker; + private readonly AbsoluteMoveCommandInvoker absoluteMoveCommandInvoker; + private readonly RelativeMoveCommandInvoker relativeMoveCommandInvoker; + private readonly ContinuousMoveCommandInvoker continuousMoveCommandInvoker; + private readonly StopCommandInvoker stopCommandInvoker; + private readonly GetConfigurationsCommandInvoker getConfigurationsCommandInvoker; + private readonly GetConfigurationCommandInvoker getConfigurationCommandInvoker; + private readonly GetConfigurationOptionsCommandInvoker getConfigurationOptionsCommandInvoker; + private readonly SetConfigurationCommandInvoker setConfigurationCommandInvoker; + private readonly GetStatusCommandInvoker getStatusCommandInvoker; + private readonly GetPresetsCommandInvoker getPresetsCommandInvoker; + private readonly SetPresetCommandInvoker setPresetCommandInvoker; + private readonly RemovePresetCommandInvoker removePresetCommandInvoker; + private readonly GotoPresetCommandInvoker gotoPresetCommandInvoker; + private readonly GotoHomePositionCommandInvoker gotoHomePositionCommandInvoker; + private readonly SetHomePositionCommandInvoker setHomePositionCommandInvoker; + private readonly SendAuxiliaryCommandCommandInvoker sendAuxiliaryCommandCommandInvoker; + + public Client(IMqttPubSubClient mqttClient) + { + this.CustomTopicTokenMap = new(); + + this.getNodesCommandInvoker = new GetNodesCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getNodeCommandInvoker = new GetNodeCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.absoluteMoveCommandInvoker = new AbsoluteMoveCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.relativeMoveCommandInvoker = new RelativeMoveCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.continuousMoveCommandInvoker = new ContinuousMoveCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.stopCommandInvoker = new StopCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getConfigurationsCommandInvoker = new GetConfigurationsCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getConfigurationCommandInvoker = new GetConfigurationCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getConfigurationOptionsCommandInvoker = new GetConfigurationOptionsCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.setConfigurationCommandInvoker = new SetConfigurationCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getStatusCommandInvoker = new GetStatusCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.getPresetsCommandInvoker = new GetPresetsCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.setPresetCommandInvoker = new SetPresetCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.removePresetCommandInvoker = new RemovePresetCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.gotoPresetCommandInvoker = new GotoPresetCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.gotoHomePositionCommandInvoker = new GotoHomePositionCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.setHomePositionCommandInvoker = new SetHomePositionCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + this.sendAuxiliaryCommandCommandInvoker = new SendAuxiliaryCommandCommandInvoker(mqttClient) { CustomTopicTokenMap = this.CustomTopicTokenMap }; + } + + public GetNodesCommandInvoker GetNodesCommandInvoker { get => this.getNodesCommandInvoker; } + public GetNodeCommandInvoker GetNodeCommandInvoker { get => this.getNodeCommandInvoker; } + public AbsoluteMoveCommandInvoker AbsoluteMoveCommandInvoker { get => this.absoluteMoveCommandInvoker; } + public RelativeMoveCommandInvoker RelativeMoveCommandInvoker { get => this.relativeMoveCommandInvoker; } + public ContinuousMoveCommandInvoker ContinuousMoveCommandInvoker { get => this.continuousMoveCommandInvoker; } + public StopCommandInvoker StopCommandInvoker { get => this.stopCommandInvoker; } + public GetConfigurationsCommandInvoker GetConfigurationsCommandInvoker { get => this.getConfigurationsCommandInvoker; } + public GetConfigurationCommandInvoker GetConfigurationCommandInvoker { get => this.getConfigurationCommandInvoker; } + public GetConfigurationOptionsCommandInvoker GetConfigurationOptionsCommandInvoker { get => this.getConfigurationOptionsCommandInvoker; } + public SetConfigurationCommandInvoker SetConfigurationCommandInvoker { get => this.setConfigurationCommandInvoker; } + public GetStatusCommandInvoker GetStatusCommandInvoker { get => this.getStatusCommandInvoker; } + public GetPresetsCommandInvoker GetPresetsCommandInvoker { get => this.getPresetsCommandInvoker; } + public SetPresetCommandInvoker SetPresetCommandInvoker { get => this.setPresetCommandInvoker; } + public RemovePresetCommandInvoker RemovePresetCommandInvoker { get => this.removePresetCommandInvoker; } + public GotoPresetCommandInvoker GotoPresetCommandInvoker { get => this.gotoPresetCommandInvoker; } + public GotoHomePositionCommandInvoker GotoHomePositionCommandInvoker { get => this.gotoHomePositionCommandInvoker; } + public SetHomePositionCommandInvoker SetHomePositionCommandInvoker { get => this.setHomePositionCommandInvoker; } + public SendAuxiliaryCommandCommandInvoker SendAuxiliaryCommandCommandInvoker { get => this.sendAuxiliaryCommandCommandInvoker; } + + public Dictionary CustomTopicTokenMap { get; private init; } + + public RpcCallAsync GetNodesAsync(CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.getNodesCommandInvoker.InvokeCommandAsync("", new EmptyJson(), metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync GetNodeAsync(GetNodeRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.getNodeCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync AbsoluteMoveAsync(AbsoluteMoveRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.absoluteMoveCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync RelativeMoveAsync(RelativeMoveRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.relativeMoveCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync ContinuousMoveAsync(ContinuousMoveRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.continuousMoveCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync StopAsync(StopRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.stopCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync GetConfigurationsAsync(CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.getConfigurationsCommandInvoker.InvokeCommandAsync("", new EmptyJson(), metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync GetConfigurationAsync(GetConfigurationRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.getConfigurationCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync GetConfigurationOptionsAsync(GetConfigurationOptionsRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.getConfigurationOptionsCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync SetConfigurationAsync(SetConfigurationRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.setConfigurationCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync GetStatusAsync(GetStatusRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.getStatusCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync GetPresetsAsync(GetPresetsRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.getPresetsCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync SetPresetAsync(SetPresetRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.setPresetCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync RemovePresetAsync(RemovePresetRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.removePresetCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync GotoPresetAsync(GotoPresetRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.gotoPresetCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync GotoHomePositionAsync(GotoHomePositionRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.gotoHomePositionCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync SetHomePositionAsync(SetHomePositionRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.setHomePositionCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public RpcCallAsync SendAuxiliaryCommandAsync(SendAuxiliaryCommandRequestPayload request, CommandRequestMetadata? requestMetadata = null, TimeSpan? commandTimeout = default, CancellationToken cancellationToken = default) + { + CommandRequestMetadata metadata = requestMetadata ?? new CommandRequestMetadata(); + return new RpcCallAsync(this.sendAuxiliaryCommandCommandInvoker.InvokeCommandAsync("", request, metadata, commandTimeout, cancellationToken), metadata.CorrelationId); + } + + public async ValueTask DisposeAsync() + { + await this.getNodesCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.getNodeCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.absoluteMoveCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.relativeMoveCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.continuousMoveCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.stopCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.getConfigurationsCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.getConfigurationCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.getConfigurationOptionsCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.setConfigurationCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.getStatusCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.getPresetsCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.setPresetCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.removePresetCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.gotoPresetCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.gotoHomePositionCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.setHomePositionCommandInvoker.DisposeAsync().ConfigureAwait(false); + await this.sendAuxiliaryCommandCommandInvoker.DisposeAsync().ConfigureAwait(false); + } + + public async ValueTask DisposeAsync(bool disposing) + { + await this.getNodesCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.getNodeCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.absoluteMoveCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.relativeMoveCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.continuousMoveCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.stopCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.getConfigurationsCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.getConfigurationCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.getConfigurationOptionsCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.setConfigurationCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.getStatusCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.getPresetsCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.setPresetCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.removePresetCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.gotoPresetCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.gotoHomePositionCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.setHomePositionCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + await this.sendAuxiliaryCommandCommandInvoker.DisposeAsync(disposing).ConfigureAwait(false); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveCommandExecutor.g.cs new file mode 100644 index 0000000..589f01d --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'RelativeMove'. + /// + public class RelativeMoveCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal RelativeMoveCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "RelativeMove", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveCommandInvoker.g.cs new file mode 100644 index 0000000..aa5443c --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'RelativeMove'. + /// + public class RelativeMoveCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal RelativeMoveCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "RelativeMove", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveRequestPayload.g.cs new file mode 100644 index 0000000..ad9cb70 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RelativeMoveRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class RelativeMoveRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("RelativeMove")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_RelativeMove__1 RelativeMove { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (RelativeMove is null) + { + throw new ArgumentNullException("RelativeMove field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (RelativeMove is null) + { + throw new ArgumentNullException("RelativeMove field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetCommandExecutor.g.cs new file mode 100644 index 0000000..cfd8e82 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'RemovePreset'. + /// + public class RemovePresetCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal RemovePresetCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "RemovePreset", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetCommandInvoker.g.cs new file mode 100644 index 0000000..1b404dc --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'RemovePreset'. + /// + public class RemovePresetCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal RemovePresetCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "RemovePreset", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetRequestPayload.g.cs new file mode 100644 index 0000000..a31bd64 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/RemovePresetRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class RemovePresetRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("RemovePreset")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_RemovePreset__1 RemovePreset { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (RemovePreset is null) + { + throw new ArgumentNullException("RemovePreset field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (RemovePreset is null) + { + throw new ArgumentNullException("RemovePreset field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandCommandExecutor.g.cs new file mode 100644 index 0000000..ac8ced7 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'SendAuxiliaryCommand'. + /// + public class SendAuxiliaryCommandCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal SendAuxiliaryCommandCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "SendAuxiliaryCommand", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandCommandInvoker.g.cs new file mode 100644 index 0000000..0e1953a --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'SendAuxiliaryCommand'. + /// + public class SendAuxiliaryCommandCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal SendAuxiliaryCommandCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "SendAuxiliaryCommand", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandRequestPayload.g.cs new file mode 100644 index 0000000..efbff95 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class SendAuxiliaryCommandRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("SendAuxiliaryCommand")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_SendAuxiliaryCommand__1 SendAuxiliaryCommand { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (SendAuxiliaryCommand is null) + { + throw new ArgumentNullException("SendAuxiliaryCommand field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (SendAuxiliaryCommand is null) + { + throw new ArgumentNullException("SendAuxiliaryCommand field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandResponsePayload.g.cs new file mode 100644 index 0000000..e16634e --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SendAuxiliaryCommandResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class SendAuxiliaryCommandResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("SendAuxiliaryCommandResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_SendAuxiliaryCommandResponse__1 SendAuxiliaryCommandResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (SendAuxiliaryCommandResponse is null) + { + throw new ArgumentNullException("SendAuxiliaryCommandResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (SendAuxiliaryCommandResponse is null) + { + throw new ArgumentNullException("SendAuxiliaryCommandResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationCommandExecutor.g.cs new file mode 100644 index 0000000..71ed419 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'SetConfiguration'. + /// + public class SetConfigurationCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal SetConfigurationCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "SetConfiguration", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationCommandInvoker.g.cs new file mode 100644 index 0000000..4f8785c --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'SetConfiguration'. + /// + public class SetConfigurationCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal SetConfigurationCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "SetConfiguration", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationRequestPayload.g.cs new file mode 100644 index 0000000..46e0e81 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetConfigurationRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class SetConfigurationRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("SetConfiguration")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_SetConfiguration__1 SetConfiguration { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (SetConfiguration is null) + { + throw new ArgumentNullException("SetConfiguration field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (SetConfiguration is null) + { + throw new ArgumentNullException("SetConfiguration field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionCommandExecutor.g.cs new file mode 100644 index 0000000..cd71187 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'SetHomePosition'. + /// + public class SetHomePositionCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal SetHomePositionCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "SetHomePosition", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionCommandInvoker.g.cs new file mode 100644 index 0000000..9519b22 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'SetHomePosition'. + /// + public class SetHomePositionCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal SetHomePositionCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "SetHomePosition", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionRequestPayload.g.cs new file mode 100644 index 0000000..22cd8d3 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetHomePositionRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class SetHomePositionRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("SetHomePosition")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_SetHomePosition__1 SetHomePosition { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (SetHomePosition is null) + { + throw new ArgumentNullException("SetHomePosition field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (SetHomePosition is null) + { + throw new ArgumentNullException("SetHomePosition field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetCommandExecutor.g.cs new file mode 100644 index 0000000..46140cf --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'SetPreset'. + /// + public class SetPresetCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal SetPresetCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "SetPreset", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetCommandInvoker.g.cs new file mode 100644 index 0000000..de6fa8b --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'SetPreset'. + /// + public class SetPresetCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal SetPresetCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "SetPreset", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetRequestPayload.g.cs new file mode 100644 index 0000000..8540f10 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class SetPresetRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("SetPreset")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_SetPreset__1 SetPreset { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (SetPreset is null) + { + throw new ArgumentNullException("SetPreset field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (SetPreset is null) + { + throw new ArgumentNullException("SetPreset field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetResponsePayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetResponsePayload.g.cs new file mode 100644 index 0000000..c98a07c --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/SetPresetResponsePayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class SetPresetResponsePayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command response argument. + /// + [JsonPropertyName("SetPresetResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_SetPresetResponse__1 SetPresetResponse { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (SetPresetResponse is null) + { + throw new ArgumentNullException("SetPresetResponse field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (SetPresetResponse is null) + { + throw new ArgumentNullException("SetPresetResponse field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopCommandExecutor.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopCommandExecutor.g.cs new file mode 100644 index 0000000..e7fb58f --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopCommandExecutor.g.cs @@ -0,0 +1,32 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes a CommandExecutor class for Command 'Stop'. + /// + public class StopCommandExecutor : CommandExecutor + { + /// + /// Initializes a new instance of the class. + /// + internal StopCommandExecutor(IMqttPubSubClient mqttClient) + : base(mqttClient, "Stop", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopCommandInvoker.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopCommandInvoker.g.cs new file mode 100644 index 0000000..dcf3b91 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopCommandInvoker.g.cs @@ -0,0 +1,30 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using Azure.Iot.Operations.Protocol; + using Azure.Iot.Operations.Protocol.RPC; + using Azure.Iot.Operations.Protocol.Models; + using PTZ; + + public static partial class Ptz + { + /// + /// Specializes the CommandInvoker class for Command 'Stop'. + /// + public class StopCommandInvoker : CommandInvoker + { + /// + /// Initializes a new instance of the class. + /// + internal StopCommandInvoker(IMqttPubSubClient mqttClient) + : base(mqttClient, "Stop", new Utf8JsonSerializer()) + { + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopRequestPayload.g.cs b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopRequestPayload.g.cs new file mode 100644 index 0000000..eca70ad --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/PTZ/dtmi_onvif_ptz__1/StopRequestPayload.g.cs @@ -0,0 +1,38 @@ +/* Code generated by Azure.Iot.Operations.ProtocolCompiler; DO NOT EDIT. */ + +#nullable enable + +namespace PTZ.dtmi_onvif_ptz__1 +{ + using System; + using System.Collections.Generic; + using System.Text.Json.Serialization; + using PTZ; + + public class StopRequestPayload : IJsonOnDeserialized, IJsonOnSerializing + { + /// + /// The Command request argument. + /// + [JsonPropertyName("Stop")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonRequired] + public Object_Onvif_Ptz_Stop__1 Stop { get; set; } = default!; + + void IJsonOnDeserialized.OnDeserialized() + { + if (Stop is null) + { + throw new ArgumentNullException("Stop field cannot be null"); + } + } + + void IJsonOnSerializing.OnSerializing() + { + if (Stop is null) + { + throw new ArgumentNullException("Stop field cannot be null"); + } + } + } +} diff --git a/samples/aio-onvif-connector-ptz-demo/README.md b/samples/aio-onvif-connector-ptz-demo/README.md new file mode 100644 index 0000000..b7b1682 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/README.md @@ -0,0 +1,235 @@ +# Azure IoT Operations connector for ONVIF PTZ demo + +## Sample Application + +This sample application demonstrates how to use the MRPC API provided by the connector for ONVIF to interact with an ONVIF device. The sample consists of two .NET assemblies: + +- **PTZ**: This assembly contains code to interact with the PTZ service of an ONVIF device. It's generated from the PTZ service DTDL file. +- **Aio.Onvif.Connector.Ptz.Demo**: A simple console application that demonstrates how to use the PTZ assembly to move the camera. + +## Build instructions +Make sure you have the .NET 8.0 SDK installed. You can download it for various platforms from the [Download .NET](https://dotnet.microsoft.com/download) site. + +After it's installed, open this folder in your terminal and run `dotnet build`. + +## Prerequisites + +- An ONVIF compliant camera that supports PTZ operations. This sample was tested using a Tapo C210 camera. + +- Azure IoT Operations deployed to your Kubernetes cluster. If you haven't deployed Azure IoT Operations yet, see [Quickstart: Run Azure IoT Operations Preview in GitHub Codespaces](https://learn.microsoft.com/azure/iot-operations/get-started-end-to-end-sample/quickstart-deploy) or [Azure IoT Operations deployment details](https://learn.microsoft.com/azure/iot-operations/deploy-iot-ops/overview-deploy). + +## Create custom resources + +Create the following custom resources in your Kubernetes cluster to configure the connector for ONVIF. + +To create a credentials secret for your ONVIF device, create a file called *credentials.yaml* with the following content. Add base64 encoded versions of your username and password in the `data` section: + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: c210-1-credentials +data: + username: # base64 encoded username for your ONVIF device + password: # base64 encoded password for your ONVIF device +type: Opaque +``` + +> TIP: To encode a string to base64, you can use the following command: `echo -n 'your-string' | base64`. + +Run the following command to create the credentials: + +```bash +kubectl apply -f credentials.yaml +``` + +To cretae an asset endpoint for the ONVIF camera, create a file called *aep.yaml* with the following content. Add the URL of your ONVIF device in the `targetAddress` field. For the Tapo C210 camera, the URL looks like `http://:2020/onvif/device_service`: + +```yaml +apiVersion: deviceregistry.microsoft.com/v1 +kind: AssetEndpointProfile +metadata: + name: c210-4a826d41 +spec: + additionalConfiguration: |- + { + "$schema": "https://aiobrokers.blob.core.windows.net/aio-onvif-connector/1.0.0.json" + } + endpointProfileType: Microsoft.Onvif + targetAddress: # The target address of the ONVIF device + authentication: + method: UsernamePassword + usernamePasswordCredentials: + usernameSecretName: c210-1-credentials/username # this refers to the secret created in the previous step + passwordSecretName: c210-1-credentials/password # this refers to the secret created in the previous step +``` + +Run the following command to create the asset endpoint: + +```bash +kubectl apply -f aep.yaml +``` + +To create a PTZ asset assigned to the asset endpoint you created in the previous step, create a file called *asset.yaml* with the following content: + +```yaml +apiVersion: deviceregistry.microsoft.com/v1 +kind: Asset +metadata: + name: c210-4a826d41-ptz # Important: the name must end with 'ptz' +spec: + displayName: tapo C210 + assetEndpointProfileRef: c210-4a826d41 # this refers to the AEP created in the previous step +``` + +Run the following command to create the asset: + +```bash +kubectl apply -f asset.yaml +``` + +## Retrieve profile token + +Run the following powershell script to get the profile token you need to run the PTZ demo. Before you run the script, add your camera IP address, username, and password: + +```powershell +# Define the camera's IP address and credentials +$cameraIP = ":2020" # Replace with your camera's IP address +$username = "" # Replace with your camera's username +$password = "" # Replace with your camera's password + +# Define the ONVIF service URL +$onvifServiceURL = "http://$cameraIP/onvif/device_service" + +# Create nonce and timestamp +$nonceBytes = [System.Text.Encoding]::UTF8.GetBytes([guid]::NewGuid().ToString()) +$nonce = [System.Convert]::ToBase64String($nonceBytes) +$timestamp = [System.DateTime]::UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ") +$timestampBytes = [System.Text.Encoding]::UTF8.GetBytes($timestamp) +$passwordBytes = [System.Text.Encoding]::UTF8.GetBytes($password) +$combined = $nonceBytes + $timestampBytes + $passwordBytes +$combinedHashed = [System.Security.Cryptography.SHA1]::Create().ComputeHash($combined) +$combinedString = [System.Convert]::ToBase64String($combinedHashed) + +# Create the XML request to get media profiles with wsse:UsernameToken +$requestXml = @" + + + + + $username + $combinedString + $nonce + $timestamp + + + + + + + +"@ + +# Set up the HTTP request headers +$headers = @{ + "Content-Type" = "application/soap+xml" +} + +# Send the request to the ONVIF service +try { + $response = Invoke-RestMethod -Uri $onvifServiceURL -Method Post -Headers $headers -Body $requestXml -SkipHeaderValidation + + # Convert response to XmlDocument + $responseXml = New-Object System.Xml.XmlDocument + $responseXml.LoadXml($response.OuterXml) + + # Extract and display the media profile tokens from the response + $namespaceManager = New-Object System.Xml.XmlNamespaceManager($responseXml.NameTable) + $namespaceManager.AddNamespace("s", "http://www.w3.org/2003/05/soap-envelope") + $namespaceManager.AddNamespace("trt", "http://www.onvif.org/ver10/media/wsdl") + + $profiles = $responseXml.SelectNodes("//trt:Profiles", $namespaceManager) + + foreach ($profile in $profiles) { + $profileToken = $profile.Attributes["token"].Value + Write-Output "Profile Token: $profileToken" + } +} catch { + Write-Output "Error: $_" +} +``` + +Make a note of the output from this script, you use it in a later step. + +### Create a broker listener + +Create a file called *broker-listener.yaml* with the following content: + +```yaml +apiVersion: mqttbroker.iotoperations.azure.com/v1 +kind: BrokerListener +metadata: + name: test-listener + namespace: azure-iot-operations +spec: + brokerRef: default + serviceType: LoadBalancer + ports: + - port: 1883 + protocol: Mqtt +``` + +> IMPORTANT: This configuration is for testing purposes only. In a production environment, use a secure connection. + +Run the following command to create the broker listener: + +```bash +kubectl apply -f broker-listener.yaml -n azure-iot-operations +``` + +### Update the Azure IoT Operations configuration + +Update the Azure IoT Operations configuration to use the broker listener you created in the previous step: + +```bash +kubectl set env deployment/aio-opc-supervisor opcuabroker_MqttOptions__MqttBroker=mqtt://test-listener.azure-iot-operations:1883 opcuabroker_MqttOptions__AuthenticationMethod=None -n azure-iot-operations +``` + +### Port forward the broker listener + +Port forward the broker listener to your local machine in a second terminal: + +```bash +kubectl port-forward svc/test-listener -n azure-iot-operations 1883:1883 +``` + +Leave this shell open to keep the port forward active. + +## Run the sample application + +To start the sample application, run `dotnet run --project Aio.Onvif.Connector.Ptz.Demo` + +The application prompts you for the following information: + +- *Mqtt Broker Hostname and Port*: localhost and the port you forwarded in the previous step. +- *Azure IoT Operations Namespace*: 'azure-iot-operations' for a standard Azure IoT Operations deployment. +- *Asset Name*: The name of the PTZ asset that's assigned to the asset endpoint of the camera you want to move. +- *Profile Token*: the profile token from an earlier step. + +After you enter this information, the application connects to the Azure IoT Operations MQ broker and you can move the camera with keyboard input. Press 'Q' to exit the application. + +To verfiy that the camera is moving, you can connect to the camera's live stream by using a tool such as **VLC media player**. In the case of the Tapo C210 camera, you can use the following URL to connect to the RTSP stream: `rtsp:///stream1`. + +## Cleanup + +To remove the resources created in the previous steps and restore the configuration, run the following commands: + +```bash +kubectl delete secret c210-1-credentials +kubectl delete assetendpointprofile c210-4a826d41 +kubectl delete asset c210-4a826d41-ptz +kubectl delete brokerlistener test-listener -n azure-iot-operations +kubectl set env deployment/aio-opc-supervisor opcuabroker_MqttOptions__MqttBroker=mqtts://aio-broker.azure-iot-operations:18883 opcuabroker_MqttOptions__AuthenticationMethod=ServiceAccountToken -n azure-iot-operations +``` diff --git a/samples/aio-onvif-connector-ptz-demo/nuget.config b/samples/aio-onvif-connector-ptz-demo/nuget.config new file mode 100644 index 0000000..9bbdc60 --- /dev/null +++ b/samples/aio-onvif-connector-ptz-demo/nuget.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file