From 1ffa4a76d89cd7e8da99a46d3da0c08915119f3a Mon Sep 17 00:00:00 2001 From: leandrofars Date: Tue, 28 May 2024 22:21:21 -0300 Subject: [PATCH] fea(cwmp): parameterAttributeStruct + parameters isWritable helper --- .../services/controller/internal/cwmp/cwmp.go | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/backend/services/controller/internal/cwmp/cwmp.go b/backend/services/controller/internal/cwmp/cwmp.go index 5c51b86..eaa4ff2 100644 --- a/backend/services/controller/internal/cwmp/cwmp.go +++ b/backend/services/controller/internal/cwmp/cwmp.go @@ -9,6 +9,12 @@ import ( "time" ) +const WRITABLE = "1" + +func ParamTypeIsWritable(param string) bool { + return param == WRITABLE +} + type SoapEnvelope struct { XMLName xml.Name Header SoapHeader @@ -41,6 +47,12 @@ type ParameterInfoStruct struct { Writable string } +type ParameterAttributeStruct struct { + Name string + Notification int + AccessList []string +} + type SetParameterValues_ struct { ParameterList []ParameterValueStruct `xml:"Body>SetParameterValues>ParameterList>ParameterValueStruct"` ParameterKey string `xml:"Body>SetParameterValues>ParameterKey>string"` @@ -55,6 +67,10 @@ type GetParameterNames_ struct { NextLevel string `xml:"Body>GetParameterNames>NextLevel"` } +type GetParameterAttributes_ struct { + ParameterNames []string `xml:"Body>GetParameterAttributes>ParameterNames>string"` +} + type GetParameterValuesResponse struct { ParameterList []ParameterValueStruct `xml:"Body>GetParameterValuesResponse>ParameterList>ParameterValueStruct"` } @@ -63,6 +79,10 @@ type GetParameterNamesResponse struct { ParameterList []ParameterInfoStruct `xml:"Body>GetParameterNamesResponse>ParameterList>ParameterInfoStruct"` } +type GetParameterAttributesResponse struct { + ParameterList []ParameterAttributeStruct `xml:"Body>GetParameterAttributesResponse>ParameterList>ParameterAttributeStruct"` +} + type CWMPInform struct { DeviceId DeviceID `xml:"Body>Inform>DeviceId"` Events []EventStruct `xml:"Body>Inform>Event>EventStruct"`