MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Parse

Function Parse

pkg/messageprocessors/normalizedpayload/uplink.go:534–546  ·  view source on GitHub ↗

Parse parses and validates the measurements.

(measurements []*structpb.Struct)

Source from the content-addressed store, hash-verified

532
533// Parse parses and validates the measurements.
534func Parse(measurements []*structpb.Struct) ([]ParsedMeasurement, error) {
535 res := make([]ParsedMeasurement, len(measurements))
536 for i, src := range measurements {
537 res[i].Valid = &structpb.Struct{
538 Fields: make(map[string]*structpb.Value),
539 }
540 err := parse(&res[i], src, "")
541 if err != nil {
542 return nil, err
543 }
544 }
545 return res, nil
546}
547
548func parse(dst *ParsedMeasurement, src *structpb.Struct, prefix string) error {
549 for k, v := range src.GetFields() {

Callers 3

TestDecodeUplinkFunction · 0.92
decodeUplinkMethod · 0.92
TestUplinkFunction · 0.92

Calls 1

parseFunction · 0.70

Tested by 2

TestDecodeUplinkFunction · 0.74
TestUplinkFunction · 0.74