func TimePtr(x time.Time) *time.Time {
	return &x
}
TimePtr converts time to a pointer.
package mqtt
import (
	"context"
	"fmt"
	"strconv"
	"time"
	ttnpbv2 "go.thethings.network/lorawan-stack-legacy/v2/pkg/ttnpb"
	"go.thethings.network/lorawan-stack/v3/pkg/band"
	"go.thethings.network/lorawan-stack/v3/pkg/errors"
	"go.thethings.network/lorawan-stack/v3/pkg/gatewayserver/io/mqtt/topics"
	"go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
	"go.thethings.network/lorawan-stack/v3/pkg/util/datarate"
)
const eirpDelta = 2.15
var (
	sourceToV3 = map[ttnpbv2.LocationMetadata_LocationSource]ttnpb.LocationSource{
		ttnpbv2.LocationMetadata_GPS:            ttnpb.SOURCE_GPS,
		ttnpbv2.LocationMetadata_CONFIG:         ttnpb.SOURCE_REGISTRY,
		ttnpbv2.LocationMetadata_REGISTRY:       ttnpb.SOURCE_REGISTRY,
		ttnpbv2.LocationMetadata_IP_GEOLOCATION: ttnpb.SOURCE_IP_GEOLOCATION,
	}
	frequencyPlanToBand = map[ttnpbv2.FrequencyPlan]string{
		ttnpbv2.FrequencyPlan_EU_863_870: "EU_863_870",
		ttnpbv2.FrequencyPlan_US_902_928: "US_902_928",
		ttnpbv2.FrequencyPlan_CN_779_787: "CN_779_787",
		ttnpbv2.FrequencyPlan_EU_433:     "EU_433",
		ttnpbv2.FrequencyPlan_AU_915_928: "AU_915_928",
		ttnpbv2.FrequencyPlan_CN_470_510: "CN_470_510",
		ttnpbv2.FrequencyPlan_AS_923:     "AS_923",
		ttnpbv2.FrequencyPlan_AS_920_923: "AS_923",
		ttnpbv2.FrequencyPlan_AS_923_925: "AS_923",
		ttnpbv2.FrequencyPlan_KR_920_923: "KR_920_923",
		ttnpbv2.FrequencyPlan_IN_865_867: "IN_865_867",
		ttnpbv2.FrequencyPlan_RU_864_870: "RU_864_870",
	}
	errNotScheduled    = errors.DefineInvalidArgument("not_scheduled", "not scheduled")
	errLoRaWANPayload  = errors.DefineInvalidArgument("lorawan_payload", "invalid LoRaWAN payload")
	errLoRaWANMetadata = errors.DefineInvalidArgument("lorawan_metadata", "missing LoRaWAN metadata")
	errDataRate        = errors.DefineInvalidArgument("data_rate", "unknown data rate `{data_rate}`")
	errModulation      = errors.DefineInvalidArgument("modulation", "unknown modulation `{modulation}`")
	errFrequencyPlan   = errors.DefineNotFound("frequency_plan", "unknown frequency plan `{frequency_plan}`")
)
type protobufv2 struct {
	topics.Layout
}