diff options
| -rw-r--r-- | examples/mqtt/main.go | 4 | ||||
| -rw-r--r-- | examples/radio/main.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/mqtt/main.go b/examples/mqtt/main.go index 0ad9c5f..35058d4 100644 --- a/examples/mqtt/main.go +++ b/examples/mqtt/main.go @@ -44,11 +44,11 @@ func channelHandler(channel string) mqtt.HandlerFunc { var message pb.Data err = proto.Unmarshal(decodedMessage, &message) - log.Info(processMessage(message), "topic", m.Topic, "channel", channel, "portnum", message.Portnum.String()) + log.Info(processMessage(&message), "topic", m.Topic, "channel", channel, "portnum", message.Portnum.String()) } } -func processMessage(message pb.Data) string { +func processMessage(message *pb.Data) string { if message.Portnum == pb.PortNum_NODEINFO_APP { var user = pb.User{} proto.Unmarshal(message.Payload, &user) diff --git a/examples/radio/main.go b/examples/radio/main.go index feda4bd..5b438f1 100644 --- a/examples/radio/main.go +++ b/examples/radio/main.go @@ -44,7 +44,7 @@ func main() { client.Handle(new(pb.MeshPacket), func(msg proto.Message) { pkt := msg.(*pb.MeshPacket) data := pkt.GetDecoded() - log.Info("Received message from radio", "msg", processMessage(*data), "from", pkt.From, "portnum", data.Portnum.String()) + log.Info("Received message from radio", "msg", processMessage(data), "from", pkt.From, "portnum", data.Portnum.String()) }) ctxTimeout, cancelTimeout := context.WithTimeout(ctx, 10*time.Second) defer cancelTimeout() @@ -56,7 +56,7 @@ func main() { <-ctx.Done() } -func processMessage(message pb.Data) string { +func processMessage(message *pb.Data) string { if message.Portnum == pb.PortNum_NODEINFO_APP { var user = pb.User{} proto.Unmarshal(message.Payload, &user) |
