-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwlan1_set_security_keys.go
36 lines (33 loc) · 1.26 KB
/
wlan1_set_security_keys.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
34
35
36
package lan
import (
"encoding/xml"
"github.com/nitram509/gofritz/pkg/soap"
"github.com/nitram509/gofritz/pkg/tr064model"
)
// Wlan1SetSecurityKeys AUTO-GENERATED (do not edit) code from [wlanconfigSCPD],
// based on SOAP action 'SetSecurityKeys', Fritz!Box-System-Version 164.08.00
//
// [wlanconfigSCPD]: http://fritz.box:49000/wlanconfigSCPD.xml
func Wlan1SetSecurityKeys(session *soap.SoapSession, wepKey0 string, wepKey1 string, wepKey2 string, wepKey3 string, preSharedKey string, keyPassphrase string) (tr064model.SetSecurityKeysResponse, error) {
fbAction, err := soap.NewSoapRequest(session).
ReqPath("/upnp/control/wlanconfig1").
Uri("urn:dslforum-org:service:WLANConfiguration:1").
Action("SetSecurityKeys").
AddStringParam("NewWEPKey0", wepKey0).
AddStringParam("NewWEPKey1", wepKey1).
AddStringParam("NewWEPKey2", wepKey2).
AddStringParam("NewWEPKey3", wepKey3).
AddStringParam("NewPreSharedKey", preSharedKey).
AddStringParam("NewKeyPassphrase", keyPassphrase).
Do()
if err != nil {
return tr064model.SetSecurityKeysResponse{}, err
}
bodyData := fbAction.Body.Data
result := tr064model.SetSecurityKeysResponse{}
err = xml.Unmarshal(bodyData, &result)
if err != nil {
return tr064model.SetSecurityKeysResponse{}, err
}
return result, nil
}