Documentation ¶
Index ¶
- Variables
- func FSPL(distance float64, freq float64) float64
- func LogDistance(distance float64, distanceRef float64, gamma float64, freq float64) float64
- type PacketConfig
- func (pc PacketConfig) NPayload() float64
- func (pc PacketConfig) NPreamble() float64
- func (pc PacketConfig) PayloadValid() bool
- func (pc PacketConfig) PreambleValid() bool
- func (pc PacketConfig) SymbolRate() float64
- func (pc PacketConfig) SymbolTime() float64
- func (pc PacketConfig) Throughput() float64
- func (pc PacketConfig) TimePayload() float64
- func (pc PacketConfig) TimePreamble() float64
- func (pc PacketConfig) TimeTotal() float64
Constants ¶
This section is empty.
Variables ¶
var PacketConfigDefault = PacketConfig{ PayloadLen: 1, PreambleLen: 6, SpreadingFactor: 7, BandWidth: 125, CodingRate: 5, CRC: false, ExplicitHeader: false, LowDataRateOptimization: false, }
PacketConfigDefault represents a default packet config.
Functions ¶
func FSPL ¶
FSPL represents the Free-space path loss based on a distance and the frequency (in MHz) of a signal.
func LogDistance ¶
LogDistance represents the log-distance path loss model.
- distance is the distance between the nodes - distanceRef is the reference distance in the same unit as distance (usually 1 km (or 1 mile) for a large cell and 1 m to 10 m for a microcell) - gamma is the path loss exponent (example values are: free space = 2, urban area = 2.7 - 3.5, obstructed in building = 4 - 6) - freq is the frequency at which the signal is sent
Types ¶
type PacketConfig ¶
type PacketConfig struct { PayloadLen float64 `json:"payloadLen"` PreambleLen float64 `json:"preambleLen"` SpreadingFactor float64 `json:"spreadingFactor"` BandWidth float64 `json:"bandWidth"` CodingRate float64 `json:"codingRate"` CRC bool `json:"crc"` ExplicitHeader bool `json:"explicitHeader"` LowDataRateOptimization bool `json:"lowDataRateOptimization"` }
PacketConfig represents a LoRa packet configuration that is needed to calculate the airtime.
func (PacketConfig) NPayload ¶
func (pc PacketConfig) NPayload() float64
func (PacketConfig) NPreamble ¶
func (pc PacketConfig) NPreamble() float64
func (PacketConfig) PayloadValid ¶
func (pc PacketConfig) PayloadValid() bool
func (PacketConfig) PreambleValid ¶
func (pc PacketConfig) PreambleValid() bool
func (PacketConfig) SymbolRate ¶
func (pc PacketConfig) SymbolRate() float64
func (PacketConfig) SymbolTime ¶
func (pc PacketConfig) SymbolTime() float64
func (PacketConfig) Throughput ¶
func (pc PacketConfig) Throughput() float64
func (PacketConfig) TimePayload ¶
func (pc PacketConfig) TimePayload() float64
TimePayload represents the time the payload alone will be on air.
func (PacketConfig) TimePreamble ¶
func (pc PacketConfig) TimePreamble() float64
TimePreamble represents the time the preamble alone will be on air.
func (PacketConfig) TimeTotal ¶
func (pc PacketConfig) TimeTotal() float64
TimeTotal represents the total time the packet will be on air.