summaryrefslogtreecommitdiff
path: root/staging/src/github.com
diff options
context:
space:
mode:
authorwbc6080 <wangbincheng4@huawei.com>2023-11-29 15:17:17 +0800
committerwbc6080 <wangbincheng4@huawei.com>2023-12-11 15:04:33 +0800
commit3fa64c3dbed689c4d0c65df96f16e5ca66fbc91c (patch)
tree36d3dcfaa819ef55ac0ddb8d55d06f25f102489b /staging/src/github.com
parentMerge pull request #5222 from lishaokai1995/master (diff)
downloadkubeedge-3fa64c3dbed689c4d0c65df96f16e5ca66fbc91c.tar.gz
update mapper framework const
Signed-off-by: wbc6080 <wangbincheng4@huawei.com>
Diffstat (limited to 'staging/src/github.com')
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go4
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/devicetwin.go2
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go4
3 files changed, 3 insertions, 7 deletions
diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go
index c4ddf7de8..29e33cf55 100644
--- a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go
+++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go
@@ -170,7 +170,7 @@ func pushHandler(ctx context.Context, twin *common.Twin, client *driver.Customiz
}
reportCycle := time.Duration(twin.Property.ReportCycle)
if reportCycle == 0 {
- reportCycle = 1 * time.Second
+ reportCycle = common.DefaultReportCycle
}
ticker := time.NewTicker(reportCycle)
go func() {
@@ -214,7 +214,7 @@ func dbHandler(ctx context.Context, twin *common.Twin, client *driver.Customized
}
reportCycle := time.Duration(twin.Property.ReportCycle)
if reportCycle == 0 {
- reportCycle = 1 * time.Second
+ reportCycle = common.DefaultReportCycle
}
ticker := time.NewTicker(reportCycle)
go func() {
diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/devicetwin.go b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/devicetwin.go
index 5df21570e..a4dc338d6 100644
--- a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/devicetwin.go
+++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/devicetwin.go
@@ -92,7 +92,7 @@ func (td *TwinData) Run(ctx context.Context) {
return
}
if td.CollectCycle == 0 {
- td.CollectCycle = 1 * time.Second
+ td.CollectCycle = common.DefaultCollectCycle
}
ticker := time.NewTicker(td.CollectCycle)
for {
diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go
index 8daf38118..315f8fdb8 100644
--- a/staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go
+++ b/staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go
@@ -27,10 +27,6 @@ const (
DEVSTUNKNOWN = "UNKNOWN"
)
const (
- ProtocolBlueTooth = "bluetooth"
- ProtocolModbus = "modbus"
- ProtocolOnvif = "onvif"
- ProtocolOpcua = "opcua"
ProtocolCustomized = "customized-protocol"
)