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

Function Get

pkg/band/all.go:259–269  ·  view source on GitHub ↗

Get returns the band if it was found, and returns an error otherwise.

(id string, version ttnpb.PHYVersion)

Source from the content-addressed store, hash-verified

257
258// Get returns the band if it was found, and returns an error otherwise.
259func Get(id string, version ttnpb.PHYVersion) (Band, error) {
260 versions, ok := All[id]
261 if !ok {
262 return Band{}, errBandNotFound.WithAttributes("id", id, "version", version)
263 }
264 band, ok := versions[version]
265 if !ok {
266 return Band{}, errBandNotFound.WithAttributes("id", id, "version", version)
267 }
268 return band, nil
269}
270
271// GetLatest returns the latest version of the band if it was found,
272// and returns an error otherwise.

Callers 6

TestLoRaWANEncodingMACFunction · 0.92
MakeCFListFunction · 0.92
lorawan.goFile · 0.92
processDownlinkFunction · 0.92
SetDefaultsFunction · 0.92
TestFindDataRateFunction · 0.70

Calls 1

WithAttributesMethod · 0.45

Tested by 3

TestLoRaWANEncodingMACFunction · 0.74
MakeCFListFunction · 0.74
TestFindDataRateFunction · 0.56