Open redwolf2019 opened 3 years ago
File location:chirpstack-network-server/internal/data/data.go
chirpstack-network-server/internal/data/data.go
Source code:
func setPingSlotParameters(ctx *dataContext) error { if !ctx.DeviceProfile.SupportsClassB { return nil } if classBPingSlotDR != ctx.DeviceSession.PingSlotDR || classBPingSlotFrequency != ctx.DeviceSession.PingSlotFrequency { block := maccommand.RequestPingSlotChannel(ctx.DeviceSession.DevEUI, classBPingSlotDR, classBPingSlotFrequency) ctx.MACCommands = append(ctx.MACCommands, block) } return nil }
Bug:
if classBPingSlotDR != ctx.DeviceSession.PingSlotDR || classBPingSlotFrequency != ctx.DeviceSession.PingSlotFrequency { block := maccommand.RequestPingSlotChannel(ctx.DeviceSession.DevEUI, classBPingSlotDR, classBPingSlotFrequency) ctx.MACCommands = append(ctx.MACCommands, block) }
According to my opinion,PingSlotDR/classBPingSlotFrequency always loading from chirpstack-network-server.toml, not loading from ctx.DeviceSession.
PingSlotDR/classBPingSlotFrequency
chirpstack-network-server.toml
ctx.DeviceSession
My Patch is:
var classBPingSlotDRReal int if classBPingSlotDR != ctx.DeviceSession.PingSlotDR { classBPingSlotDRReal = ctx.DeviceSession.PingSlotDR }else { classBPingSlotDRReal = classBPingSlotDR } var classBPingSlotFrequencyReal uint32 if classBPingSlotFrequency != ctx.DeviceSession.PingSlotFrequency { classBPingSlotFrequencyReal = ctx.DeviceSession.PingSlotFrequency }else { classBPingSlotFrequencyReal = classBPingSlotFrequency } block := maccommand.RequestPingSlotChannel(ctx.DeviceSession.DevEUI, classBPingSlotDRReal, classBPingSlotFrequencyReal) ctx.MACCommands = append(ctx.MACCommands, block)
Is my idea correct? Looking forward to your reply:)
File location:
chirpstack-network-server/internal/data/data.go
Source code:
Bug:
According to my opinion,
PingSlotDR/classBPingSlotFrequency
always loading fromchirpstack-network-server.toml
, not loading fromctx.DeviceSession
.My Patch is:
Is my idea correct? Looking forward to your reply:)