This commit is contained in:
@ -115,14 +115,17 @@ func (self *TTNHandler) Handle(message handler.MessageT) {
|
|||||||
|
|
||||||
log.Printf("DeviceLabel: %s, DeviceType: %s", device.Label, device.DeviceType.ModelIdentifier)
|
log.Printf("DeviceLabel: %s, DeviceType: %s", device.Label, device.DeviceType.ModelIdentifier)
|
||||||
|
|
||||||
|
var parser func(interface{}) ([]database.VariableType, error)
|
||||||
switch device.DeviceType.ModelIdentifier {
|
switch device.DeviceType.ModelIdentifier {
|
||||||
case "emu-prof-ii-lora":
|
case "emu-prof-ii-lora":
|
||||||
_, err3 := emuProfIILoRa.Parse(uplinkMessage.UplinkMessage.DecodedPayload)
|
parser = emuProfIILoRa.Parse
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err3 := parser(uplinkMessage.UplinkMessage.DecodedPayload)
|
||||||
if err3 != nil {
|
if err3 != nil {
|
||||||
lost(fmt.Sprintf("Model parser failed: %s", err3), message)
|
lost(fmt.Sprintf("Model parser failed: %s", err3), message)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user