当前位置: 首页>>代码示例>>Golang>>正文


Golang Setting.Sensorbroadcastperiod方法代码示例

本文整理汇总了Golang中github.com/grayzone/devicemonitor/conn.Setting.Sensorbroadcastperiod方法的典型用法代码示例。如果您正苦于以下问题:Golang Setting.Sensorbroadcastperiod方法的具体用法?Golang Setting.Sensorbroadcastperiod怎么用?Golang Setting.Sensorbroadcastperiod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/grayzone/devicemonitor/conn.Setting的用法示例。


在下文中一共展示了Setting.Sensorbroadcastperiod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: worker


//.........这里部分代码省略.........

			s.Maxretrycount = sessionres.MaxRetryCount
			s.UpdateMaxretrycount()

		case ftprotocol.DEVICENAMERESPONSE:
			var res ftprotocol.DeviceNameResponse
			res.Frame = f
			err := res.ParseMessageData(f.MessageData)
			if err != nil {
				log.Println(err.Error())
				m.Status = conn.INVALID
				m.UpdateStatus()
				continue
			}
			var s conn.Setting
			//		log.Println("device  name : ", res.StringName)
			s.Devicename = res.StringName
			err = s.UpdateDevicename()
			if err != nil {
				log.Println("UpdateDevicename:", err.Error())
			}

		case ftprotocol.GETSENSORRESPONSE:
			var res ftprotocol.GetSensorResponse
			res.Frame = f
			err := res.ParseMessageData(f.MessageData)
			if err != nil {
				log.Println("GETSENSORRESPONSE:", err.Error())
				m.Status = conn.INVALID
				m.UpdateStatus()
				continue
			}
			var s conn.Setting
			s.Sensorbroadcastperiod = res.BroadcastPeriod
			err = s.UpdateSensorbroadcastperiod()
			if err != nil {
				log.Println("UpdateSensorbroadcastperiod :", err.Error())
			}

		case ftprotocol.DSP1SENSORDATA:
			var res ftprotocol.Dsp1SensorData
			res.Frame = f
			err := res.ParseMessageData(f.MessageData)
			if err != nil {
				log.Println("DSP1SENSORDATA:", err.Error())
				m.Status = conn.INVALID
				m.UpdateStatus()
				continue
			}
			var s conn.Sensordata
			s.Isvaliddata = res.IsValidData
			s.Sequencenumber = res.SequenceNumber
			s.Isactivatingflag = res.IsActivatingFlag
			s.Vavg = res.Vavg
			s.Iavg = res.Iavg
			s.Pavg = res.Pavg
			s.Vrms = res.Vrms
			s.Irms = res.Irms
			s.Viphase = res.Viphase
			s.Vpk = res.Vpk
			s.Ipk = res.Ipk
			s.Vcf = res.Vcf
			s.Icf = res.Icf
			s.Zload = res.Zload
			s.T1 = res.T1
			s.T2 = res.T2
开发者ID:grayzone,项目名称:devicemonitor,代码行数:67,代码来源:devicemonitor.go


注:本文中的github.com/grayzone/devicemonitor/conn.Setting.Sensorbroadcastperiod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。