func (d DeviceQueueItem) Validate() error {
	if d.FPort == 0 {
		return ErrInvalidFPort
	}
	return nil
}
Validate validates the DeviceQueueItem.
package storage
import (
	"context"
	"time"
	"github.com/jmoiron/sqlx"
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
	"github.com/brocaar/chirpstack-network-server/v3/internal/gps"
	"github.com/brocaar/chirpstack-network-server/v3/internal/helpers/classb"
	"github.com/brocaar/chirpstack-network-server/v3/internal/logging"
	"github.com/brocaar/lorawan"
)
const (
	classBScheduleMargin = 5 * time.Second
)
type DeviceQueueItem struct {
	ID                      int64           `db:"id"`
	CreatedAt               time.Time       `db:"created_at"`
	UpdatedAt               time.Time       `db:"updated_at"`
	DevAddr                 lorawan.DevAddr `db:"dev_addr"`
	DevEUI                  lorawan.EUI64   `db:"dev_eui"`
	FRMPayload              []byte          `db:"frm_payload"`
	FCnt                    uint32          `db:"f_cnt"`
	FPort                   uint8           `db:"f_port"`
	Confirmed               bool            `db:"confirmed"`
	IsPending               bool            `db:"is_pending"`
	EmitAtTimeSinceGPSEpoch *time.Duration  `db:"emit_at_time_since_gps_epoch"`
	TimeoutAfter            *time.Time      `db:"timeout_after"`
	RetryAfter              *time.Time      `db:"retry_after"`
}