airtime

package
v0.0.0-...-559f553 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package airtime provides a function for calculating the time on air. This implements the formula as defined by: https://www.semtech.com/uploads/documents/LoraDesignGuide_STD.pdf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateLoRaAirtime

func CalculateLoRaAirtime(payloadSize, sf, bandwidth, preambleNumber int, codingRate CodingRate, headerEnabled, lowDataRateOptimization bool) (time.Duration, error)

CalculateLoRaAirtime calculates the airtime for a LoRa modulated frame.

func CalculateLoRaPayloadSymbolNumber

func CalculateLoRaPayloadSymbolNumber(payloadSize, sf int, codingRate CodingRate, headerEnabled, lowDataRateOptimization bool) (int, error)

CalculateLoRaPayloadSymbolNumber returns the number of symbols that make up the packet payload and header.

func CalculateLoRaPreambleDuration

func CalculateLoRaPreambleDuration(symbolDuration time.Duration, preambleNumber int) time.Duration

CalculateLoRaPreambleDuration calculates the LoRa preamble duration.

func CalculateLoRaSymbolDuration

func CalculateLoRaSymbolDuration(sf int, bandwidth int) time.Duration

CalculateLoRaSymbolDuration calculates the LoRa symbol duration.

Types

type CodingRate

type CodingRate int

CodingRate defines the coding-rate type.

const (
	CodingRate45 CodingRate = 1
	CodingRate46 CodingRate = 2
	CodingRate47 CodingRate = 3
	CodingRate48 CodingRate = 4
)

Available coding-rates.

Jump to

Keyboard shortcuts

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