mirror of
https://github.com/dpup/meshstream.git
synced 2026-05-01 02:52:26 +02:00
Track rx time
This commit is contained in:
@@ -3,6 +3,7 @@ package decoder
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
@@ -77,7 +78,10 @@ func DecodeEncodedMessage(payload []byte) (*pb.ServiceEnvelope, error) {
|
||||
|
||||
// DecodeMessage creates a Data object from a binary encoded message
|
||||
func DecodeMessage(payload []byte, topicInfo *meshtreampb.TopicInfo) *meshtreampb.Data {
|
||||
data := &meshtreampb.Data{}
|
||||
data := &meshtreampb.Data{
|
||||
// Add reception timestamp (Unix timestamp in seconds)
|
||||
RxTime: uint64(time.Now().Unix()),
|
||||
}
|
||||
|
||||
// First decode the envelope
|
||||
envelope, err := DecodeEncodedMessage(payload)
|
||||
|
||||
Reference in New Issue
Block a user