Skip to content

Commit 065a30b

Browse files
committed
Implement subscription renewal.
1 parent 8351707 commit 065a30b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

cmd/gonvif/events/stream-events.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"github.com/spf13/cobra"
55

66
"github.com/eyetowers/gonvif/cmd/gonvif/root"
7+
wsnt "github.com/eyetowers/gonvif/pkg/generated/onvif/docs_oasisopen_org/wsn/b2"
78
"github.com/eyetowers/gonvif/pkg/generated/onvif/www_onvif_org/ver10/events/wsdl"
89
"github.com/eyetowers/gonvif/pkg/gonvif"
910
)
@@ -48,5 +49,10 @@ func processEvents(subscription wsdl.PullPointSubscription) error {
4849
if err != nil {
4950
return err
5051
}
52+
var time wsnt.AbsoluteOrRelativeTimeType = "PT120S"
53+
_, err = subscription.Renew(&wsnt.Renew{TerminationTime: &time})
54+
if err != nil {
55+
return err
56+
}
5157
}
5258
}

pkg/generated/onvif/www_onvif_org/ver10/events/wsdl/0.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)