Skip to content

SetPreset #56

Open
Open

Description

@tony-516

type SetPreset struct {
XMLName string xml:"tptz:SetPreset"
ProfileToken onvif.ReferenceToken xml:"tptz:ProfileToken"
PresetName xsd.String xml:"tptz:PresetName"
PresetToken onvif.ReferenceToken xml:"tptz:PresetToken,omitempty"
}
设置预置位入参分两种:1. 有PresetName,这种情况名称和位置同步设置 2. 无PresetName,这种情况仅设置位置。 实际应用中该结构体我的配置如下:
ptz.SetPreset{
XMLName: "SetPreset",
ProfileToken: onvif.ReferenceToken(Token1),
PresetToken: onvif.ReferenceToken(Token2),
}
这种情况应该是不配置名称,仅设置位置,但是实际结果是调用成功了什么也没有设置成功。

使用调试工具只设置位置传递的参数如下:
<s:Body>
tptz:SetPreset
tptz:ProfileTokenProfile_1</tptz:ProfileToken>
tptz:PresetToken1</tptz:PresetToken>
</tptz:SetPreset>
</s:Body>

请核实一下,是不是应该在PresetName xsd.String xml:"tptz:PresetName"这里加个omitempty来适配无PresetName,这种情况仅设置位置

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions