From 1aee7f15e3ed0fc3d4bb8e6465876ea8d2d8eb3d Mon Sep 17 00:00:00 2001 From: yakovlevdmv Date: Sat, 7 Apr 2018 17:49:01 +0300 Subject: [PATCH] The scopes of device functions are edited --- Device.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Device.go b/Device.go index 118bb27..284b582 100644 --- a/Device.go +++ b/Device.go @@ -80,14 +80,17 @@ type device struct { } -func GetAvailableDevicesAtSpecificEthernetInterface(interfaceName string) { +func GetAvailableDevicesAtSpecificEthernetInterface(interfaceName string) []device { /* Call an WS-Discovery Probe Message to Discover NVT type Devices */ devices := WS_Discovery.SendProbe(interfaceName, nil, []string{"dn:"+NVT.String()}, map[string]string{"dn":"http://www.onvif.org/ver10/network/wsdl"}) + //nvtDevices := make([]device, len(devices)) for _, j := range devices { fmt.Println(j) + //nvtDevices[i] = NewDevice() } + return nil } func (dev *device) getSupportedServices() { @@ -172,14 +175,14 @@ func (dev device) CallMethod(method interface{}) (string, error) { //TODO: Get endpoint automatically if dev.login != "" && dev.password != "" { - return dev.CallAuthorizedMethod(endpoint, method) + return dev.сallAuthorizedMethod(endpoint, method) } else { - return dev.CallNonAuthorizedMethod(endpoint, method) + return dev.сallNonAuthorizedMethod(endpoint, method) } } //CallNonAuthorizedMethod functions call an method, defined struct without authentication data -func (dev device) CallNonAuthorizedMethod(endpoint string, method interface{}) (string, error) { +func (dev device) сallNonAuthorizedMethod(endpoint string, method interface{}) (string, error) { //TODO: Get endpoint automatically /* Converting struct to xml string representation @@ -208,7 +211,7 @@ func (dev device) CallNonAuthorizedMethod(endpoint string, method interface{}) ( } //CallMethod functions call an method, defined struct with authentication data -func (dev device) CallAuthorizedMethod(endpoint string, method interface{}) (string, error) { +func (dev device) сallAuthorizedMethod(endpoint string, method interface{}) (string, error) { /* Converting struct to xml string representation */