Documentation
¶
Index ¶
- Constants
- Variables
- func AdaptDataRate(ctx context.Context, dev *ttnpb.EndDevice, phy *band.Band, ...) error
- func CFList(phy *band.Band, channels ...*ttnpb.MACParameters_Channel) *ttnpb.CFList
- func DataRateIndexOverridesOf(overrides *ttnpb.ADRSettings_DynamicMode_Overrides, drIdx ttnpb.DataRateIndex) *ttnpb.ADRSettings_DynamicMode_PerDataRateIndexOverride
- func DeviceADRMargin(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings) float32
- func DeviceClassBCDownlinkInterval(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) time.Duration
- func DeviceClassBTimeout(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) time.Duration
- func DeviceClassCTimeout(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) time.Duration
- func DeviceDefaultBeaconFrequency(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) uint64
- func DeviceDefaultChannels(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) []*ttnpb.MACParameters_Channel
- func DeviceDefaultClass(dev *ttnpb.EndDevice) (ttnpb.Class, error)
- func DeviceDefaultLoRaWANVersion(dev *ttnpb.EndDevice) ttnpb.MACVersion
- func DeviceDefaultMaxDutyCycle(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) ttnpb.AggregatedDutyCycle
- func DeviceDefaultPingSlotDataRateIndexValue(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) *ttnpb.DataRateIndexValue
- func DeviceDefaultPingSlotFrequency(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) uint64
- func DeviceDefaultPingSlotPeriodicity(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) *ttnpb.PingSlotPeriodValue
- func DeviceDefaultRX1DataRateOffset(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) ttnpb.DataRateOffset
- func DeviceDefaultRX1Delay(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) ttnpb.RxDelay
- func DeviceDefaultRX2DataRateIndex(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) ttnpb.DataRateIndex
- func DeviceDefaultRX2Frequency(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) uint64
- func DeviceDefaultRelaySettings(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) *ttnpb.RelaySettings
- func DeviceDesiredADRAckDelayExponent(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) *ttnpb.ADRAckDelayExponentValue
- func DeviceDesiredADRAckLimitExponent(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) *ttnpb.ADRAckLimitExponentValue
- func DeviceDesiredBeaconFrequency(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) uint64
- func DeviceDesiredChannels(dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, ...) []*ttnpb.MACParameters_Channel
- func DeviceDesiredDownlinkDwellTime(phy *band.Band, fp *frequencyplans.FrequencyPlan) *ttnpb.BoolValue
- func DeviceDesiredMaxDutyCycle(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) ttnpb.AggregatedDutyCycle
- func DeviceDesiredMaxEIRP(dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, ...) float32
- func DeviceDesiredPingSlotDataRateIndexValue(dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, ...) *ttnpb.DataRateIndexValue
- func DeviceDesiredPingSlotFrequency(dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, ...) uint64
- func DeviceDesiredRX1DataRateOffset(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) ttnpb.DataRateOffset
- func DeviceDesiredRX1Delay(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) ttnpb.RxDelay
- func DeviceDesiredRX2DataRateIndex(dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, ...) ttnpb.DataRateIndex
- func DeviceDesiredRX2Frequency(dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, ...) uint64
- func DeviceDesiredRelaySettings(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) *ttnpb.RelaySettings
- func DeviceDesiredUplinkDwellTime(phy *band.Band, fp *frequencyplans.FrequencyPlan) *ttnpb.BoolValue
- func DeviceDownlinkDwellTime(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) *ttnpb.BoolValue
- func DeviceExpectedDownlinkDwellTime(macState *ttnpb.MACState, fp *frequencyplans.FrequencyPlan, phy *band.Band) bool
- func DeviceExpectedUplinkDwellTime(macState *ttnpb.MACState, fp *frequencyplans.FrequencyPlan, phy *band.Band) bool
- func DeviceNeedsADRParamSetupReq(dev *ttnpb.EndDevice, phy *band.Band) bool
- func DeviceNeedsBeaconFreqReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsBeaconTimingReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsDLChannelReq(dev *ttnpb.EndDevice, phy *band.Band) bool
- func DeviceNeedsDLChannelReqAtIndex(dev *ttnpb.EndDevice, i int) bool
- func DeviceNeedsDevStatusReq(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, transmitAt time.Time) bool
- func DeviceNeedsDevStatusReqAt(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings) (time.Time, bool)
- func DeviceNeedsDutyCycleReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsLinkADRReq(ctx context.Context, dev *ttnpb.EndDevice, phy *band.Band) bool
- func DeviceNeedsNewChannelReq(dev *ttnpb.EndDevice, phy *band.Band) bool
- func DeviceNeedsNewChannelReqAtIndex(dev *ttnpb.EndDevice, i int) bool
- func DeviceNeedsPingSlotChannelReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsRejoinParamSetupReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsRelayConfReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsRelayConfigureFwdLimitReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsRelayCtrlUplinkListReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsRelayCtrlUplinkListReqAtIndex(dev *ttnpb.EndDevice, i int) bool
- func DeviceNeedsRelayEndDeviceConfReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsRelayUpdateUplinkListReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsRelayUpdateUplinkListReqAtIndex(dev *ttnpb.EndDevice, i int) bool
- func DeviceNeedsRxParamSetupReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsRxTimingSetupReq(dev *ttnpb.EndDevice) bool
- func DeviceNeedsTxParamSetupReq(dev *ttnpb.EndDevice, phy *band.Band) bool
- func DevicePingSlotFrequency(dev *ttnpb.EndDevice, phy *band.Band, pingAt time.Time) uint64
- func DeviceResetsFCnt(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) bool
- func DeviceScheduleDownlinks(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) bool
- func DeviceShouldAdaptDataRate(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, phy *band.Band) (adaptDataRate bool, resetDesiredParameters bool, ...)
- func DeviceStatusCountPeriodicity(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings) uint32
- func DeviceStatusTimePeriodicity(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings) time.Duration
- func DeviceSupports32BitFCnt(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings) bool
- func DeviceUplinkDwellTime(dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, ...) *ttnpb.BoolValue
- func DeviceUseADR(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, phy *band.Band) bool
- func HandleADRParamSetupAns(ctx context.Context, dev *ttnpb.EndDevice) (events.Builders, error)
- func HandleBeaconFreqAns(ctx context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_BeaconFreqAns) (events.Builders, error)
- func HandleBeaconTimingReq(ctx context.Context, dev *ttnpb.EndDevice) (events.Builders, error)
- func HandleDLChannelAns(ctx context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_DLChannelAns) (events.Builders, error)
- func HandleDevStatusAns(ctx context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_DevStatusAns, ...) (events.Builders, error)
- func HandleDeviceModeInd(ctx context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_DeviceModeInd) (events.Builders, error)
- func HandleDeviceTimeReq(ctx context.Context, dev *ttnpb.EndDevice, msg *ttnpb.UplinkMessage) (events.Builders, error)
- func HandleDutyCycleAns(ctx context.Context, dev *ttnpb.EndDevice) (events.Builders, error)
- func HandleLinkADRAns(ctx context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_LinkADRAns, ...) (events.Builders, error)
- func HandleLinkCheckReq(ctx context.Context, dev *ttnpb.EndDevice, msg *ttnpb.UplinkMessage) (events.Builders, error)
- func HandleNewChannelAns(ctx context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_NewChannelAns) (events.Builders, error)
- func HandlePingSlotChannelAns(ctx context.Context, dev *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandlePingSlotInfoReq(ctx context.Context, dev *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandleRejoinParamSetupAns(ctx context.Context, dev *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandleRekeyInd(ctx context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_RekeyInd, ...) (events.Builders, error)
- func HandleRelayConfAns(_ context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_RelayConfAns) (events.Builders, error)
- func HandleRelayConfigureFwdLimitAns(_ context.Context, dev *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandleRelayCtrlUplinkListAns(_ context.Context, dev *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandleRelayEndDeviceConfAns(_ context.Context, dev *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandleRelayNotifyNewEndDeviceReq(_ context.Context, _ *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandleRelayUpdateUplinkListAns(_ context.Context, dev *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandleResetInd(_ context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_ResetInd, ...) (events.Builders, error)
- func HandleRxParamSetupAns(ctx context.Context, dev *ttnpb.EndDevice, ...) (events.Builders, error)
- func HandleRxTimingSetupAns(ctx context.Context, dev *ttnpb.EndDevice) (events.Builders, error)
- func HandleTxParamSetupAns(ctx context.Context, dev *ttnpb.EndDevice) (events.Builders, error)
- func LossRate(macState *ttnpb.MACState, phy *band.Band) float32
- func NewState(dev *ttnpb.EndDevice, fps *frequencyplans.Store, defaults *ttnpb.MACSettings, ...) (*ttnpb.MACState, error)
- func NextPingSlotAt(ctx context.Context, dev *ttnpb.EndDevice, earliestAt time.Time) (time.Time, bool)
- func RelayParametersFromRelaySettings(settings *ttnpb.RelaySettings, phy *band.Band) *ttnpb.RelayParameters
- func ServedRelayParametersFromServedRelaySettings(settings *ttnpb.ServedRelaySettings, phy *band.Band) *ttnpb.ServedRelayParameters
- func ServingRelayParametersFromServingRelaySettings(settings *ttnpb.ServingRelaySettings) *ttnpb.ServingRelayParameters
- type EnqueueState
- func EnqueueADRParamSetupReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ...) EnqueueState
- func EnqueueBeaconFreqReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueDLChannelReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ...) EnqueueState
- func EnqueueDevStatusReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ...) EnqueueState
- func EnqueueDutyCycleReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueForceRejoinReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueLinkADRReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ...) (EnqueueState, error)
- func EnqueueNewChannelReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ...) EnqueueState
- func EnqueuePingSlotChannelReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueRejoinParamSetupReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueRelayConfReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueRelayConfigureFwdLimitReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueRelayCtrlUplinkListReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueRelayEndDeviceConfReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueRelayUpdateUplinkListReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ...) EnqueueState
- func EnqueueRxParamSetupReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueRxTimingSetupReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
- func EnqueueTxParamSetupReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ...) EnqueueState
- type RelayKeyService
Constants ¶
const ( // OptimalADRUplinkCount is the amount of uplinks required to ensure optimal results from the ADR algorithm. OptimalADRUplinkCount = 20 // DefaultADRMargin is the default ADR margin used if not specified in MACSettings of the device or NS-wide defaults. DefaultADRMargin = 15 )
const ( DefaultStatusCountPeriodicity uint32 = 200 DefaultStatusTimePeriodicity = 24 * time.Hour )
const (
BeaconPeriod = 128 * time.Second
)
const DefaultClassBTimeout = 10 * time.Minute
DefaultClassBTimeout is the default time-out for the device to respond to class B downlink messages. When waiting for a response times out, the downlink message is considered lost, and the downlink task triggers again.
const DefaultClassCTimeout = 5 * time.Minute
DefaultClassCTimeout is the default time-out for the device to respond to class C downlink messages. When waiting for a response times out, the downlink message is considered lost, and the downlink task triggers again.
Variables ¶
var ( EvtEnqueueADRParamSetupRequest = defineEnqueueMACRequestEvent( "adr_param_setup", "ADR parameter setup", events.WithDataType(&ttnpb.MACCommand_ADRParamSetupReq{}), )() EvtReceiveADRParamSetupAnswer = defineReceiveMACAnswerEvent( "adr_param_setup", "ADR parameter setup", )() )
var ( EvtEnqueueBeaconFreqRequest = defineEnqueueMACRequestEvent( "beacon_freq", "beacon frequency change", events.WithDataType(&ttnpb.MACCommand_BeaconFreqReq{}), )() EvtReceiveBeaconFreqReject = defineReceiveMACRejectEvent( "beacon_freq", "beacon frequency change", events.WithDataType(&ttnpb.MACCommand_BeaconFreqAns{}), )() EvtReceiveBeaconFreqAccept = defineReceiveMACAcceptEvent( "beacon_freq", "beacon frequency change", events.WithDataType(&ttnpb.MACCommand_BeaconFreqAns{}), )() )
var ( EvtEnqueueDevStatusRequest = defineEnqueueMACRequestEvent( "dev_status", "device status", )() EvtReceiveDevStatusAnswer = defineReceiveMACAnswerEvent( "dev_status", "device status", events.WithDataType(&ttnpb.MACCommand_DevStatusAns{}), )() )
var ( EvtReceiveDeviceModeIndication = defineReceiveMACIndicationEvent( "device_mode", "device mode", events.WithDataType(&ttnpb.MACCommand_DeviceModeInd{}), )() EvtEnqueueDeviceModeConfirmation = defineEnqueueMACConfirmationEvent( "device_mode", "device mode", events.WithDataType(&ttnpb.MACCommand_DeviceModeConf{}), )() )
var ( EvtReceiveDeviceTimeRequest = defineReceiveMACRequestEvent( "device_time", "device time", )() EvtEnqueueDeviceTimeAnswer = defineEnqueueMACAnswerEvent( "device_time", "device time", events.WithData(&ttnpb.MACCommand_DeviceTimeAns{}), )() )
var ( EvtEnqueueDLChannelRequest = defineEnqueueMACRequestEvent( "dl_channel", "downlink Rx1 channel frequency modification", events.WithDataType(&ttnpb.MACCommand_DLChannelReq{}), )() EvtReceiveDLChannelAccept = defineReceiveMACAcceptEvent( "dl_channel", "downlink Rx1 channel frequency modification", events.WithDataType(&ttnpb.MACCommand_DLChannelAns{}), )() EvtReceiveDLChannelReject = defineReceiveMACRejectEvent( "dl_channel", "downlink Rx1 channel frequency modification", events.WithDataType(&ttnpb.MACCommand_DLChannelAns{}), )() )
var ( EvtEnqueueDutyCycleRequest = defineEnqueueMACRequestEvent( "duty_cycle", "maximum aggregated transmit duty-cycle change", events.WithDataType(&ttnpb.MACCommand_DutyCycleReq{}), )() EvtReceiveDutyCycleAnswer = defineReceiveMACAnswerEvent( "duty_cycle", "maximum aggregated transmit duty-cycle change", )() )
var ( ErrRequestNotFound = errors.DefineInvalidArgument( "request_not_found", "MAC response received, but corresponding request not found", "cid", ) ErrNoPayload = errors.DefineInvalidArgument("no_payload", "no message payload specified") )
var ( EvtEnqueueLinkADRRequest = defineEnqueueMACRequestEvent( "link_adr", "link ADR", events.WithDataType(&ttnpb.MACCommand_LinkADRReq{}), )() EvtReceiveLinkADRAccept = defineReceiveMACAcceptEvent( "link_adr", "link ADR", events.WithDataType(&ttnpb.MACCommand_LinkADRAns{}), )() EvtReceiveLinkADRReject = defineReceiveMACRejectEvent( "link_adr", "link ADR", events.WithDataType(&ttnpb.MACCommand_LinkADRAns{}), )() )
var ( EvtReceiveLinkCheckRequest = defineReceiveMACRequestEvent( "link_check", "link check", )() EvtEnqueueLinkCheckAnswer = defineEnqueueMACAnswerEvent( "link_check", "link check", events.WithDataType(&ttnpb.MACCommand_LinkCheckAns{}), )() )
var ( EvtEnqueueNewChannelRequest = defineEnqueueMACRequestEvent( "new_channel", "new channel", events.WithDataType(&ttnpb.MACCommand_NewChannelReq{}), )() EvtReceiveNewChannelAccept = defineReceiveMACAcceptEvent( "new_channel", "new channel", events.WithDataType(&ttnpb.MACCommand_NewChannelAns{}), )() EvtReceiveNewChannelReject = defineReceiveMACRejectEvent( "new_channel", "new channel", events.WithDataType(&ttnpb.MACCommand_NewChannelAns{}), )() )
var ( EvtEnqueueProprietaryMACAnswer = defineEnqueueMACAnswerEvent("proprietary", "proprietary MAC command") EvtEnqueueProprietaryMACRequest = defineEnqueueMACRequestEvent("proprietary", "proprietary MAC command") EvtReceiveProprietaryMAC = events.Define( "ns.mac.proprietary.receive", "receive proprietary MAC command", events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), ) EvtClassASwitch = defineClassSwitchEvent('a')() EvtClassBSwitch = defineClassSwitchEvent('b')() EvtClassCSwitch = defineClassSwitchEvent('c')() EvtParseMACCommandFail = events.Define( "ns.mac.command.parse.fail", "parse MAC command", events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), events.WithErrorDataType(), events.WithPropagateToParent(), ) EvtUnknownMACCommand = events.Define( "ns.mac.command.unknown", "unknown MAC command", events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), events.WithDataType(&ttnpb.MACCommand{}), ) EvtProcessMACCommandFail = events.Define( "ns.mac.command.process.fail", "process MAC command", events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), events.WithErrorDataType(), events.WithPropagateToParent(), ) EvtUnansweredMACCommand = events.Define( "ns.mac.command.unanswered", "MAC command answer missing", events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), events.WithDataType(&ttnpb.MACCommands{}), ) )
var ( EvtEnqueuePingSlotChannelRequest = defineEnqueueMACRequestEvent( "ping_slot_channel", "ping slot channel", events.WithDataType(&ttnpb.MACCommand_PingSlotChannelReq{}), )() EvtReceivePingSlotChannelAccept = defineReceiveMACAcceptEvent( "ping_slot_channel", "ping slot channel", events.WithDataType(&ttnpb.MACCommand_PingSlotChannelAns{}), )() EvtReceivePingSlotChannelReject = defineReceiveMACRejectEvent( "ping_slot_channel", "ping slot channel", events.WithDataType(&ttnpb.MACCommand_PingSlotChannelAns{}), )() )
var ( EvtEnqueuePingSlotInfoAnswer = defineEnqueueMACAnswerEvent( "ping_slot_info", "ping slot info", )() EvtReceivePingSlotInfoRequest = defineReceiveMACRequestEvent( "ping_slot_info", "ping slot info", events.WithDataType(&ttnpb.MACCommand_PingSlotInfoReq{}), )() )
var ( EvtEnqueueRejoinParamSetupRequest = defineEnqueueMACRequestEvent( "rejoin_param_setup", "rejoin parameter setup", events.WithDataType(&ttnpb.MACCommand_RejoinParamSetupReq{}), )() EvtReceiveRejoinParamSetupAnswer = defineReceiveMACAnswerEvent( "rejoin_param_setup", "rejoin parameter setup", events.WithDataType(&ttnpb.MACCommand_RejoinParamSetupAns{}), )() )
var ( EvtReceiveRekeyIndication = defineReceiveMACIndicationEvent( "rekey", "device rekey", events.WithDataType(&ttnpb.MACCommand_RekeyInd{}), )() EvtEnqueueRekeyConfirmation = defineEnqueueMACConfirmationEvent( "rekey", "device rekey", events.WithDataType(&ttnpb.MACCommand_RekeyConf{}), )() )
var ( // EvtEnqueueRelayConfRequest is emitted when a relay configuration request is enqueued. EvtEnqueueRelayConfRequest = defineEnqueueMACRequestEvent( "relay_conf", "relay configuration", events.WithDataType(&ttnpb.MACCommand_RelayConfReq{}), )() // EvtReceiveRelayConfAccept is emitted when a relay configuration request is accepted. EvtReceiveRelayConfAccept = defineReceiveMACAcceptEvent( "relay_conf", "relay configuration", events.WithDataType(&ttnpb.MACCommand_RelayConfAns{}), )() // EvtReceiveRelayConfReject is emitted when a relay configuration request is rejected. EvtReceiveRelayConfReject = defineReceiveMACRejectEvent( "relay_conf", "relay configuration", events.WithDataType(&ttnpb.MACCommand_RelayConfAns{}), )() )
var ( // EvtEnqueueRelayConfigureFwdLimitRequest is emitted when a relay forward limits configuration request is enqueued. EvtEnqueueRelayConfigureFwdLimitRequest = defineEnqueueMACRequestEvent( "relay_configure_fwd_limit", "relay configure forward limit", events.WithDataType(&ttnpb.MACCommand_RelayConfigureFwdLimitReq{}), )() // EvtReceiveRelayConfigureFwdLimitAnswer is emitted when a relay forward limits configuration request is answered. EvtReceiveRelayConfigureFwdLimitAnswer = defineReceiveMACAnswerEvent( "relay_configure_fwd_limit", "relay configure forward limit", events.WithDataType(&ttnpb.MACCommand_RelayConfigureFwdLimitAns{}), )() )
var ( // EvtEnqueueRelayCtrlUplinkListRequest is emitted when a relay control uplink list request is enqueued. EvtEnqueueRelayCtrlUplinkListRequest = defineEnqueueMACRequestEvent( "relay_ctrl_uplink_list", "relay control uplink list", events.WithDataType(&ttnpb.MACCommand_RelayCtrlUplinkListReq{}), )() // EvtReceiveRelayCtrlUplinkListAccept is emitted when a relay control uplink list request is accepted. EvtReceiveRelayCtrlUplinkListAccept = defineReceiveMACAcceptEvent( "relay_ctrl_uplink_list", "relay control uplink list", events.WithDataType(&ttnpb.MACCommand_RelayCtrlUplinkListAns{}), )() // EvtReceiveRelayCtrlUplinkListReject is emitted when a relay control uplink list request is rejected. EvtReceiveRelayCtrlUplinkListReject = defineReceiveMACRejectEvent( "relay_ctrl_uplink_list", "relay control uplink list", events.WithDataType(&ttnpb.MACCommand_RelayCtrlUplinkListAns{}), )() )
var ( // EvtEnqueueRelayEndDeviceConfRequest is emitted when a relay end device configuration request is enqueued. EvtEnqueueRelayEndDeviceConfRequest = defineEnqueueMACRequestEvent( "relay_end_device_conf", "relay end device configuration", events.WithDataType(&ttnpb.MACCommand_RelayEndDeviceConfReq{}), )() // EvtReceiveRelayEndDeviceConfAccept is emitted when a relay end device configuration request is accepted. EvtReceiveRelayEndDeviceConfAccept = defineReceiveMACAcceptEvent( "relay_end_device_conf", "relay end device configuration", events.WithDataType(&ttnpb.MACCommand_RelayEndDeviceConfAns{}), )() // EvtReceiveRelayEndDeviceConfReject is emitted when a relay end device configuration request is rejected. EvtReceiveRelayEndDeviceConfReject = defineReceiveMACRejectEvent( "relay_end_device_conf", "relay end device configuration", events.WithDataType(&ttnpb.MACCommand_RelayEndDeviceConfAns{}), )() )
var ( // EvtEnqueueRelayUpdateUplinkListRequest is emitted when a relay update uplink list request is enqueued. EvtEnqueueRelayUpdateUplinkListRequest = defineEnqueueMACRequestEvent( "relay_update_uplink_list", "relay update uplink list", events.WithDataType(&ttnpb.MACCommand_RelayUpdateUplinkListReq{}), )() // EvtReceiveRelayUpdateUplinkListAnswer is emitted when a relay update uplink list request is answered. EvtReceiveRelayUpdateUplinkListAnswer = defineReceiveMACAnswerEvent( "relay_update_uplink_list", "relay update uplink list", events.WithDataType(&ttnpb.MACCommand_RelayUpdateUplinkListAns{}), )() )
var ( EvtReceiveResetIndication = defineReceiveMACIndicationEvent( "reset", "device reset", events.WithDataType(&ttnpb.MACCommand_ResetInd{}), )() EvtEnqueueResetConfirmation = defineEnqueueMACConfirmationEvent( "reset", "device reset", events.WithDataType(&ttnpb.MACCommand_ResetConf{}), )() )
var ( EvtEnqueueRxParamSetupRequest = defineEnqueueMACRequestEvent( "rx_param_setup", "Rx parameter setup", events.WithDataType(&ttnpb.MACCommand_RxParamSetupReq{}), )() EvtReceiveRxParamSetupAccept = defineReceiveMACAcceptEvent( "rx_param_setup", "Rx parameter setup", events.WithDataType(&ttnpb.MACCommand_RxParamSetupAns{}), )() EvtReceiveRxParamSetupReject = defineReceiveMACRejectEvent( "rx_param_setup", "Rx parameter setup", events.WithDataType(&ttnpb.MACCommand_RxParamSetupAns{}), )() )
var ( EvtEnqueueRxTimingSetupRequest = defineEnqueueMACRequestEvent( "rx_timing_setup", "Rx timing setup", events.WithDataType(&ttnpb.MACCommand_RxTimingSetupReq{}), )() EvtReceiveRxTimingSetupAnswer = defineReceiveMACAnswerEvent( "rx_timing_setup", "Rx timing setup", )() )
var ( EvtEnqueueTxParamSetupRequest = defineEnqueueMACRequestEvent( "tx_param_setup", "Tx parameter setup", events.WithDataType(&ttnpb.MACCommand_TxParamSetupReq{}), )() EvtReceiveTxParamSetupAnswer = defineReceiveMACAnswerEvent( "tx_param_setup", "Tx parameter setup", )() )
var ContainsStickyMACCommand = containsAnyMACCommandIdentifier( ttnpb.MACCommandIdentifier_CID_DL_CHANNEL, ttnpb.MACCommandIdentifier_CID_RX_PARAM_SETUP, ttnpb.MACCommandIdentifier_CID_RX_TIMING_SETUP, ttnpb.MACCommandIdentifier_CID_TX_PARAM_SETUP, )
ContainsStickyMACCommand checks if any of the provided MAC command identifiers exhibit sticky behavior. See STICKY.md.
var EvtEnqueueForceRejoinRequest = defineEnqueueMACRequestEvent("force_rejoin", "force rejoin")()
var EvtReceiveRelayNotifyNewEndDeviceIndication = defineReceiveMACIndicationEvent(
"relay_notify_new_end_device", "relay notify new end device",
)()
EvtReceiveRelayNotifyNewEndDeviceIndication is emitted when a relay notify new end device indication is received.
Functions ¶
func AdaptDataRate ¶
func AdaptDataRate(ctx context.Context, dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings) error
AdaptDataRate adapts the end device desired ADR parameters based on previous transmissions and device settings.
func CFList ¶ added in v3.25.2
CFList generated by this frequency plan, for the version used by a device. This function returns nil if the CFList could not be computed, or if the device does not support CFLists.
func DataRateIndexOverridesOf ¶ added in v3.30.0
func DataRateIndexOverridesOf( overrides *ttnpb.ADRSettings_DynamicMode_Overrides, drIdx ttnpb.DataRateIndex, ) *ttnpb.ADRSettings_DynamicMode_PerDataRateIndexOverride
DataRateIndexOverridesOf returns the per-data rate index overrides of the given dynamic ADR settings.
func DeviceADRMargin ¶ added in v3.14.0
func DeviceADRMargin(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings) float32
DeviceADRMargin returns the margin to be used by the ADR algorithm.
func DeviceClassBCDownlinkInterval ¶ added in v3.14.2
func DeviceClassBCDownlinkInterval( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) time.Duration
DeviceClassBCDownlinkInterval returns the class B/C downlink interval for the device.
func DeviceClassBTimeout ¶
func DeviceClassBTimeout( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) time.Duration
DeviceClassBTimeout returns the time-out for the device to respond to class B downlink messages.
func DeviceClassCTimeout ¶
func DeviceClassCTimeout( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) time.Duration
DeviceClassCTimeout returns the time-out for the device to respond to class C downlink messages.
func DeviceDefaultBeaconFrequency ¶
func DeviceDefaultBeaconFrequency( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) uint64
DeviceDefaultBeaconFrequency returns the default beacon frequency for the device.
func DeviceDefaultChannels ¶
func DeviceDefaultChannels( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) []*ttnpb.MACParameters_Channel
DeviceDefaultChannels returns the default channels for the device.
func DeviceDefaultClass ¶
DeviceDefaultClass returns the default class for the device.
func DeviceDefaultLoRaWANVersion ¶
func DeviceDefaultLoRaWANVersion(dev *ttnpb.EndDevice) ttnpb.MACVersion
DeviceDefaultLoRaWANVersion returns the default LoRaWAN version for the device.
func DeviceDefaultMaxDutyCycle ¶
func DeviceDefaultMaxDutyCycle( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) ttnpb.AggregatedDutyCycle
DeviceDefaultMaxDutyCycle returns the default maximum duty cycle for the device.
func DeviceDefaultPingSlotDataRateIndexValue ¶
func DeviceDefaultPingSlotDataRateIndexValue( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.DataRateIndexValue
DeviceDefaultPingSlotDataRateIndexValue returns the default ping slot data rate index for the device.
func DeviceDefaultPingSlotFrequency ¶
func DeviceDefaultPingSlotFrequency( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) uint64
DeviceDefaultPingSlotFrequency returns the default ping slot frequency for the device.
func DeviceDefaultPingSlotPeriodicity ¶
func DeviceDefaultPingSlotPeriodicity( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.PingSlotPeriodValue
DeviceDefaultPingSlotPeriodicity returns the default ping slot periodicity for the device.
func DeviceDefaultRX1DataRateOffset ¶
func DeviceDefaultRX1DataRateOffset( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) ttnpb.DataRateOffset
DeviceDefaultRX1DataRateOffset returns the default RX1 data rate offset for the device.
func DeviceDefaultRX1Delay ¶
func DeviceDefaultRX1Delay( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) ttnpb.RxDelay
DeviceDefaultRX1Delay returns the default RX1 delay for the device.
func DeviceDefaultRX2DataRateIndex ¶
func DeviceDefaultRX2DataRateIndex( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) ttnpb.DataRateIndex
DeviceDefaultRX2DataRateIndex returns the default RX2 data rate index for the device.
func DeviceDefaultRX2Frequency ¶
func DeviceDefaultRX2Frequency( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) uint64
DeviceDefaultRX2Frequency returns the default RX2 frequency for the device.
func DeviceDefaultRelaySettings ¶ added in v3.29.0
func DeviceDefaultRelaySettings( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.RelaySettings
DeviceDefaultRelaySettings returns the default relay parameters for the given device.
func DeviceDesiredADRAckDelayExponent ¶
func DeviceDesiredADRAckDelayExponent( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.ADRAckDelayExponentValue
DeviceDesiredADRAckDelayExponent returns the desired ADR ack delay exponent for the device.
func DeviceDesiredADRAckLimitExponent ¶
func DeviceDesiredADRAckLimitExponent( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.ADRAckLimitExponentValue
DeviceDesiredADRAckLimitExponent returns the desired ADR ack limit exponent for the device.
func DeviceDesiredBeaconFrequency ¶
func DeviceDesiredBeaconFrequency( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) uint64
DeviceDesiredBeaconFrequency returns the desired beacon frequency for the device.
func DeviceDesiredChannels ¶
func DeviceDesiredChannels( dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) []*ttnpb.MACParameters_Channel
DeviceDesiredChannels returns the desired channels for the device.
func DeviceDesiredDownlinkDwellTime ¶
func DeviceDesiredDownlinkDwellTime(phy *band.Band, fp *frequencyplans.FrequencyPlan) *ttnpb.BoolValue
DeviceDesiredDownlinkDwellTime returns the desired downlink dwell time for the device.
func DeviceDesiredMaxDutyCycle ¶
func DeviceDesiredMaxDutyCycle( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) ttnpb.AggregatedDutyCycle
DeviceDesiredMaxDutyCycle returns the desired maximum duty cycle for the device.
func DeviceDesiredMaxEIRP ¶
func DeviceDesiredMaxEIRP( dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, _ *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) float32
DeviceDesiredMaxEIRP returns the desired maximum EIRP for the device.
func DeviceDesiredPingSlotDataRateIndexValue ¶
func DeviceDesiredPingSlotDataRateIndexValue( dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.DataRateIndexValue
DeviceDesiredPingSlotDataRateIndexValue returns the desired ping slot data rate index for the device.
func DeviceDesiredPingSlotFrequency ¶
func DeviceDesiredPingSlotFrequency( dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) uint64
DeviceDesiredPingSlotFrequency returns the desired ping slot frequency for the device.
func DeviceDesiredRX1DataRateOffset ¶
func DeviceDesiredRX1DataRateOffset( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) ttnpb.DataRateOffset
DeviceDesiredRX1DataRateOffset returns the desired RX1 data rate offset for the device.
func DeviceDesiredRX1Delay ¶
func DeviceDesiredRX1Delay( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) ttnpb.RxDelay
DeviceDesiredRX1Delay returns the desired RX1 delay for the device.
func DeviceDesiredRX2DataRateIndex ¶
func DeviceDesiredRX2DataRateIndex( dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) ttnpb.DataRateIndex
DeviceDesiredRX2DataRateIndex returns the desired RX2 data rate index for the device.
func DeviceDesiredRX2Frequency ¶
func DeviceDesiredRX2Frequency( dev *ttnpb.EndDevice, phy *band.Band, fp *frequencyplans.FrequencyPlan, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) uint64
DeviceDesiredRX2Frequency returns the desired RX2 frequency for the device.
func DeviceDesiredRelaySettings ¶ added in v3.29.0
func DeviceDesiredRelaySettings( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.RelaySettings
DeviceDesiredRelaySettings returns the desired relay parameters for the given device.
func DeviceDesiredUplinkDwellTime ¶
func DeviceDesiredUplinkDwellTime(phy *band.Band, fp *frequencyplans.FrequencyPlan) *ttnpb.BoolValue
DeviceDesiredUplinkDwellTime returns the desired uplink dwell time for the device.
func DeviceDownlinkDwellTime ¶ added in v3.18.0
func DeviceDownlinkDwellTime( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.BoolValue
DeviceDownlinkDwellTime returns the downlink dwell time for the device.
func DeviceExpectedDownlinkDwellTime ¶ added in v3.18.0
func DeviceExpectedDownlinkDwellTime( macState *ttnpb.MACState, fp *frequencyplans.FrequencyPlan, phy *band.Band, ) bool
DeviceExpectedDownlinkDwellTime returns the expected downlink dwell time for the device.
func DeviceExpectedUplinkDwellTime ¶ added in v3.18.0
func DeviceExpectedUplinkDwellTime( macState *ttnpb.MACState, fp *frequencyplans.FrequencyPlan, phy *band.Band, ) bool
DeviceExpectedUplinkDwellTime returns the expected uplink dwell time for the device.
func DeviceNeedsDLChannelReq ¶
func DeviceNeedsDevStatusReq ¶
func DeviceNeedsDutyCycleReq ¶
func DeviceNeedsLinkADRReq ¶
func DeviceNeedsRelayConfReq ¶ added in v3.28.1
DeviceNeedsRelayConfReq returns true iff the device needs a relay configuration request.
func DeviceNeedsRelayConfigureFwdLimitReq ¶ added in v3.28.1
DeviceNeedsRelayConfigureFwdLimitReq returns true iff the device needs a relay forward limits configuration request.
func DeviceNeedsRelayCtrlUplinkListReq ¶ added in v3.28.1
DeviceNeedsRelayCtrlUplinkListReq returns true iff the device needs a relay control uplink list request.
func DeviceNeedsRelayCtrlUplinkListReqAtIndex ¶ added in v3.28.1
DeviceNeedsRelayCtrlUplinkListReqAtIndex returns true iff the device needs a relay control uplink list request at the given index.
func DeviceNeedsRelayEndDeviceConfReq ¶ added in v3.28.1
DeviceNeedsRelayEndDeviceConfReq returns true iff the device needs a relay end device configuration request.
func DeviceNeedsRelayUpdateUplinkListReq ¶ added in v3.28.1
DeviceNeedsRelayUpdateUplinkListReq returns true iff the device needs a relay update uplink list request.
func DeviceNeedsRelayUpdateUplinkListReqAtIndex ¶ added in v3.28.1
DeviceNeedsRelayUpdateUplinkListReqAtIndex returns true iff the device needs a relay update uplink list request at the given index.
func DevicePingSlotFrequency ¶ added in v3.21.2
DevicePingSlotFrequency computes the frequency of the ping slot at time pingAt. If no frequency is found, this function returns 0.
func DeviceResetsFCnt ¶
func DeviceResetsFCnt( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) bool
DeviceResetsFCnt returns whether the device resets frame counters on re-join.
func DeviceScheduleDownlinks ¶ added in v3.21.0
func DeviceScheduleDownlinks( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) bool
DeviceScheduleDownlinks checks if the Network Server should schedule downlinks for the provided end device.
func DeviceShouldAdaptDataRate ¶ added in v3.19.0
func DeviceShouldAdaptDataRate(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, phy *band.Band) (adaptDataRate bool, resetDesiredParameters bool, staticSettings *ttnpb.ADRSettings_StaticMode)
DeviceShouldAdaptDataRate returns if the ADR algorithm should be run for the end device.
func DeviceStatusCountPeriodicity ¶ added in v3.14.0
func DeviceStatusCountPeriodicity(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings) uint32
func DeviceStatusTimePeriodicity ¶ added in v3.14.0
func DeviceSupports32BitFCnt ¶
func DeviceSupports32BitFCnt( dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) bool
DeviceSupports32BitFCnt returns whether the device supports 32-bit frame counters.
func DeviceUplinkDwellTime ¶ added in v3.18.0
func DeviceUplinkDwellTime( dev *ttnpb.EndDevice, phy *band.Band, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) *ttnpb.BoolValue
DeviceUplinkDwellTime returns the uplink dwell time for the device.
func DeviceUseADR ¶
DeviceUseADR returns if the Network Server uses the ADR algorithm for the end device.
func HandleADRParamSetupAns ¶
func HandleBeaconFreqAns ¶
func HandleBeaconTimingReq ¶
func HandleDLChannelAns ¶
func HandleDevStatusAns ¶
func HandleDeviceModeInd ¶
func HandleDeviceTimeReq ¶
func HandleDutyCycleAns ¶
func HandleLinkADRAns ¶
func HandleLinkCheckReq ¶
func HandleNewChannelAns ¶
func HandlePingSlotInfoReq ¶
func HandleRekeyInd ¶
func HandleRelayConfAns ¶ added in v3.28.1
func HandleRelayConfAns( _ context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_RelayConfAns, ) (events.Builders, error)
HandleRelayConfAns handles a relay configuration answer.
func HandleRelayConfigureFwdLimitAns ¶ added in v3.28.1
func HandleRelayConfigureFwdLimitAns( _ context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_RelayConfigureFwdLimitAns, ) (events.Builders, error)
HandleRelayConfigureFwdLimitAns handles a relay forward limits configuration answer.
func HandleRelayCtrlUplinkListAns ¶ added in v3.28.1
func HandleRelayCtrlUplinkListAns( _ context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_RelayCtrlUplinkListAns, ) (events.Builders, error)
HandleRelayCtrlUplinkListAns handles a relay control uplink list answer.
func HandleRelayEndDeviceConfAns ¶ added in v3.28.1
func HandleRelayEndDeviceConfAns( _ context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_RelayEndDeviceConfAns, ) (events.Builders, error)
HandleRelayEndDeviceConfAns handles a relay end device configuration answer.
func HandleRelayNotifyNewEndDeviceReq ¶ added in v3.28.1
func HandleRelayNotifyNewEndDeviceReq( _ context.Context, _ *ttnpb.EndDevice, pld *ttnpb.MACCommand_RelayNotifyNewEndDeviceReq, ) (events.Builders, error)
HandleRelayNotifyNewEndDeviceReq handles a relay notify new end device request.
func HandleRelayUpdateUplinkListAns ¶ added in v3.28.1
func HandleRelayUpdateUplinkListAns( _ context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_RelayUpdateUplinkListAns, ) (events.Builders, error)
HandleRelayUpdateUplinkListAns handles a relay update uplink list answer.
func HandleResetInd ¶
func HandleResetInd( _ context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCommand_ResetInd, fps *frequencyplans.Store, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) (events.Builders, error)
HandleResetInd handles the uplink of a reset indication. This method is called by the Network Server when an uplink with a reset indication is received.
func HandleRxParamSetupAns ¶
func HandleRxTimingSetupAns ¶
func HandleTxParamSetupAns ¶
func LossRate ¶ added in v3.30.2
LossRate calculates the loss rate of the recent uplinks in the provided MAC state.
func NewState ¶
func NewState( dev *ttnpb.EndDevice, fps *frequencyplans.Store, defaults *ttnpb.MACSettings, profile *ttnpb.MACSettings, ) (*ttnpb.MACState, error)
NewState returns a new MAC state for the device.
func NextPingSlotAt ¶
func NextPingSlotAt(ctx context.Context, dev *ttnpb.EndDevice, earliestAt time.Time) (time.Time, bool)
NextPingSlotAt returns the exact time instant before or at earliestAt when next ping slot can be open given the data known by Network Server and true, if such time instant exists, otherwise it returns time.Time{} and false.
func RelayParametersFromRelaySettings ¶ added in v3.29.0
func RelayParametersFromRelaySettings(settings *ttnpb.RelaySettings, phy *band.Band) *ttnpb.RelayParameters
RelayParametersFromRelaySettings returns the relay parameters for the given settings.
func ServedRelayParametersFromServedRelaySettings ¶ added in v3.29.0
func ServedRelayParametersFromServedRelaySettings( settings *ttnpb.ServedRelaySettings, phy *band.Band, ) *ttnpb.ServedRelayParameters
ServedRelayParametersFromServedRelaySettings returns the served relay parameters for the given settings.
func ServingRelayParametersFromServingRelaySettings ¶ added in v3.29.0
func ServingRelayParametersFromServingRelaySettings( settings *ttnpb.ServingRelaySettings, ) *ttnpb.ServingRelayParameters
ServingRelayParametersFromServingRelaySettings returns the serving relay parameters for the given settings.
Types ¶
type EnqueueState ¶
func EnqueueADRParamSetupReq ¶
func EnqueueBeaconFreqReq ¶
func EnqueueDLChannelReq ¶
func EnqueueDevStatusReq ¶
func EnqueueDevStatusReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, defaults *ttnpb.MACSettings, transmitAt time.Time) EnqueueState
func EnqueueDutyCycleReq ¶
func EnqueueForceRejoinReq ¶
func EnqueueLinkADRReq ¶
func EnqueueNewChannelReq ¶
func EnqueueRelayConfReq ¶ added in v3.28.1
func EnqueueRelayConfReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
EnqueueRelayConfReq enqueues a relay configuration request if needed.
func EnqueueRelayConfigureFwdLimitReq ¶ added in v3.28.1
func EnqueueRelayConfigureFwdLimitReq( ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ) EnqueueState
EnqueueRelayConfigureFwdLimitReq enqueues a relay forward limits configuration request if needed.
func EnqueueRelayCtrlUplinkListReq ¶ added in v3.28.1
func EnqueueRelayCtrlUplinkListReq( ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, ) EnqueueState
EnqueueRelayCtrlUplinkListReq enqueues a relay control uplink list request.
func EnqueueRelayEndDeviceConfReq ¶ added in v3.28.1
func EnqueueRelayEndDeviceConfReq(ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16) EnqueueState
EnqueueRelayEndDeviceConfReq enqueues a relay end device configuration request if needed.
func EnqueueRelayUpdateUplinkListReq ¶ added in v3.28.1
func EnqueueRelayUpdateUplinkListReq( ctx context.Context, dev *ttnpb.EndDevice, maxDownLen, maxUpLen uint16, keyService RelayKeyService, ) EnqueueState
EnqueueRelayUpdateUplinkListReq enqueues a relay update uplink list request.
func EnqueueRxParamSetupReq ¶
func EnqueueRxTimingSetupReq ¶
func EnqueueTxParamSetupReq ¶
type RelayKeyService ¶ added in v3.28.1
type RelayKeyService interface {
// BatchDeriveRootWorSKey derives the RootWorSKey for the provided end devices.
// For devices with a pending session, the derived RootWorSKey is derived rom the
// pending NwkSEncKey. For devices with an active session, the derived RootWorSKey
// is derived from the active NwkSEncKey.
BatchDeriveRootWorSKey(
ctx context.Context, appID *ttnpb.ApplicationIdentifiers, deviceIDs []string, sessionKeyIDs [][]byte,
) (devAddrs []*types.DevAddr, keys []*types.AES128Key, err error)
}
RelayKeyService provides common relay related cryptographic operations.
Source Files
¶
- adr.go
- adr_legacy.go
- adr_param_setup.go
- beacon_freq.go
- beacon_timing.go
- cflist.go
- dev_status.go
- device_mode.go
- device_time.go
- dl_channel.go
- duty_cycle.go
- errors.go
- force_rejoin.go
- link_adr.go
- link_check.go
- mac.go
- new_channel.go
- observability.go
- ping_slot_channel.go
- ping_slot_info.go
- rejoin_param_setup.go
- rekey.go
- relay.go
- relay_conf.go
- relay_configure_fwd_limit.go
- relay_ctrl_uplink_list.go
- relay_end_device_conf.go
- relay_notify_new_end_device.go
- relay_update_uplink_list.go
- reset.go
- rx_param_setup.go
- rx_timing_setup.go
- tx_param_setup.go
- utils.go