吸顶类型传感器使用特定配置项
This commit is contained in:
parent
cca97cc694
commit
da82f1a765
34
router.go
34
router.go
|
@ -48,6 +48,8 @@ func gw_router() {
|
||||||
type DparkConf struct {
|
type DparkConf struct {
|
||||||
ExtensionInTime int `json:"in"`
|
ExtensionInTime int `json:"in"`
|
||||||
ExtensionOutTime int `json:"out"`
|
ExtensionOutTime int `json:"out"`
|
||||||
|
ExtensionInTime2 int `json:"in2"`
|
||||||
|
ExtensionOutTime2 int `json:"out2"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var dparkConf DparkConf
|
var dparkConf DparkConf
|
||||||
|
@ -407,6 +409,16 @@ func dealDatav3(data []byte) string{
|
||||||
|
|
||||||
cs2001 := data[6]
|
cs2001 := data[6]
|
||||||
|
|
||||||
|
var R_data P1004_6
|
||||||
|
R_data.CODE = 1008
|
||||||
|
R_data.ID = adr
|
||||||
|
//尿布台
|
||||||
|
R_data.VERSION = "yunhorn_2_v1"
|
||||||
|
R_data.ONLINE = true
|
||||||
|
R_data.DATA = make(map[string]interface{})
|
||||||
|
R_data.DATA["cs2001"]=cs2001
|
||||||
|
|
||||||
|
|
||||||
datatypeStr := strconv.FormatInt(int64(data[5]&0xff), 16)
|
datatypeStr := strconv.FormatInt(int64(data[5]&0xff), 16)
|
||||||
|
|
||||||
cs2001Str := strconv.FormatInt(int64(data[6]&0xff), 16)
|
cs2001Str := strconv.FormatInt(int64(data[6]&0xff), 16)
|
||||||
|
@ -427,11 +439,17 @@ func dealDatav3(data []byte) string{
|
||||||
|
|
||||||
if newdtype==1{
|
if newdtype==1{
|
||||||
tof = data[7]
|
tof = data[7]
|
||||||
|
R_data.VERSION = "yunhorn_1_v1"
|
||||||
|
R_data.DATA["tof"]=tof
|
||||||
tofTmp := strconv.FormatInt(int64(data[7]&0xff), 10)
|
tofTmp := strconv.FormatInt(int64(data[7]&0xff), 10)
|
||||||
readyData.WriteString("*")
|
readyData.WriteString("*")
|
||||||
readyData.WriteString(tofTmp)
|
readyData.WriteString(tofTmp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data_bufTmp, _ := json.Marshal(R_data)
|
||||||
|
data_buf := string(data_bufTmp)
|
||||||
|
go post_to_server(data_buf)
|
||||||
|
|
||||||
// log.Println("readyData:",readyData.String())
|
// log.Println("readyData:",readyData.String())
|
||||||
|
|
||||||
// go pushCODE1007(data)
|
// go pushCODE1007(data)
|
||||||
|
@ -496,15 +514,31 @@ func dealDatav3(data []byte) string{
|
||||||
|
|
||||||
log.Println("yunhorndeug.push.data.durationAsInt64:",durationAsInt64)
|
log.Println("yunhorndeug.push.data.durationAsInt64:",durationAsInt64)
|
||||||
if current == 0 {
|
if current == 0 {
|
||||||
|
//类型2 吸顶
|
||||||
|
if datatype==2{
|
||||||
|
if durationAsInt64 < extensionOutTime2 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}else{
|
||||||
if durationAsInt64 < extensionOutTime {
|
if durationAsInt64 < extensionOutTime {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
//类型2 吸顶
|
||||||
|
if datatype==2{
|
||||||
|
if durationAsInt64 < extensionInTime2 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
if durationAsInt64 < extensionInTime {
|
if durationAsInt64 < extensionInTime {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//改变状态
|
//改变状态
|
||||||
// loraNode.(LoraNode).CHECK_TIME = false
|
// loraNode.(LoraNode).CHECK_TIME = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue