-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathset_periodic_inform.go
33 lines (30 loc) · 1.16 KB
/
set_periodic_inform.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package gateway
import (
"encoding/xml"
"github.com/nitram509/gofritz/pkg/soap"
"github.com/nitram509/gofritz/pkg/tr064model"
)
// SetPeriodicInform AUTO-GENERATED (do not edit) code from [mgmsrvSCPD],
// based on SOAP action 'SetPeriodicInform', Fritz!Box-System-Version 164.08.00
//
// [mgmsrvSCPD]: http://fritz.box:49000/mgmsrvSCPD.xml
func SetPeriodicInform(session *soap.SoapSession, periodicInformEnable bool, periodicInformInterval int, periodicInformTime string) (tr064model.SetPeriodicInformResponse, error) {
fbAction, err := soap.NewSoapRequest(session).
ReqPath("/upnp/control/mgmsrv").
Uri("urn:dslforum-org:service:ManagementServer:1").
Action("SetPeriodicInform").
AddBoolParam("NewPeriodicInformEnable", periodicInformEnable).
AddIntParam("NewPeriodicInformInterval", periodicInformInterval).
AddStringParam("NewPeriodicInformTime", periodicInformTime).
Do()
if err != nil {
return tr064model.SetPeriodicInformResponse{}, err
}
bodyData := fbAction.Body.Data
result := tr064model.SetPeriodicInformResponse{}
err = xml.Unmarshal(bodyData, &result)
if err != nil {
return tr064model.SetPeriodicInformResponse{}, err
}
return result, nil
}