fuota

package
v4.0.0-...-6e01468 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployment

type Deployment struct {
	// contains filtered or unexported fields
}

Deployments defines the FUOTA deployment struct.

func NewDeployment

func NewDeployment(opts DeploymentOptions) (*Deployment, error)

NewDeployment creates a new Deployment.

func (*Deployment) GetID

func (d *Deployment) GetID() uuid.UUID

GetID returns the random assigned FUOTA deployment ID.

func (*Deployment) HandleUplinkEvent

func (d *Deployment) HandleUplinkEvent(ctx context.Context, pl integration.UplinkEvent) error

HandleUplinkEvent handles the given uplink event. In case it does not match one of the FUOTA ports or DevEUI within the deployment, the uplink is silently discarded.

func (*Deployment) Run

func (d *Deployment) Run(ctx context.Context) error

Run starts the FUOTA update.

type DeploymentOptions

type DeploymentOptions struct {
	// The application id.
	ApplicationID string

	// The Devices to include in the update.
	// Note: the devices must be part of the above application id.
	Devices map[lorawan.EUI64]DeviceOptions

	// MulticastGroupType defines the multicast type (B/C)
	MulticastGroupType api.MulticastGroupType

	// Multicast DR defines the multicast data-rate.
	MulticastDR uint8

	// MulticastPingSlotPeriodicity defines the ping-slot periodicity (Class-B).
	// Expected values: 0 -7.
	MulticastPingSlotPeriodicity uint8

	// MulticastFrequency defines the frequency.
	MulticastFrequency uint32

	// MulticastGroupID defines the multicast group ID.
	MulticastGroupID uint8

	// MulticastTimeout defines the timeout of the multicast-session.
	// Please refer to the Remote Multicast Setup specification as this field
	// has a different meaning for Class-B and Class-C groups.
	MulticastTimeout uint8

	// MulticastRegion defines the multicast region.
	MulticastRegion common.Region

	// UnicastTimeout.
	// Set this to the value in which you at least expect an uplink frame from
	// the device. The FUOTA server will wait for the given time before
	// attempting a retry or continuing with the next step.
	UnicastTimeout time.Duration

	// UnicastAttemptCount.
	// The number of attempts before considering an unicast command
	// to be failed.
	UnicastAttemptCount int

	// FragSize defines the max size for each payload fragment.
	FragSize int

	// Payload defines the FUOTA payload.
	Payload []byte

	// Redundancy (in number of packets).
	Redundancy int

	// FragmentationSessionIndex.
	FragmentationSessionIndex uint8

	// FragmentationMatrix.
	FragmentationMatrix uint8

	// BlockAckDelay.
	BlockAckDelay uint8

	// Descriptor.
	Descriptor [4]byte

	// RequestFragmentationSessionStatus defines if and when the frag-session
	// status must be requested.
	RequestFragmentationSessionStatus FragmentationSessionStatusRequestType
}

DeploymentOptions defines the options for a FUOTA Deployment.

type DeviceOptions

type DeviceOptions struct {
	// McRootKey holds the McRootKey.
	// Note: please refer to the Remote Multicast Setup specification for more
	// information (page 10).
	McRootKey lorawan.AES128Key
}

DeviceOptions holds the device options.

type FragmentationSessionStatusRequestType

type FragmentationSessionStatusRequestType string

FragmentationSessionStatusRequestType type.

const (
	RequestFragmentationSessionStatusAfterFragmentEnqueue FragmentationSessionStatusRequestType = "AFTER_FRAGMENT_ENQUEUE"
	RequestFragmentationSessionStatusAfterSessionTimeout  FragmentationSessionStatusRequestType = "AFTER_SESSION_TIMEOUT"
	RequestFragmentationSessionStatusNoRequest            FragmentationSessionStatusRequestType = "NO_REQUEST"
)

RequestFragmentationSessionStatus options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL