model

package
v0.0.0-...-a1ed5fc Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidCrcError          = errors.New("invalid crc")
	InvalidMicError          = errors.New("invalid mic")
	InvalidMacPayloadError   = errors.New("invalid mac payload")
	InvalidFramePayloadError = errors.New("invalid frame payload")
	InvalidPayloadError      = errors.New("invalid payload")
)

Functions

This section is empty.

Types

type CompactTime

type CompactTime time.Time

func (CompactTime) MarshalJSON

func (t CompactTime) MarshalJSON() ([]byte, error)

func (CompactTime) String

func (t CompactTime) String() string

func (*CompactTime) UnmarshalJSON

func (t *CompactTime) UnmarshalJSON(data []byte) error

type Coverage

type Coverage struct {
	GatewayMac MacAddress
	DeviceAddr lorawan.DevAddr
	Time       CompactTime
	Frequency  float64
	DataRate   DataRate
	Power      int8
	RSSI       int16
	SNR        float64
	Size       uint16
	Payload    string
	Latitude   float64
	Longitude  float64
}

func (*Coverage) Unmarshal

func (c *Coverage) Unmarshal(data []byte) error

type DataRate

type DataRate struct {
	LoRa string
	FSK  uint32
}

func (DataRate) MarshalJSON

func (d DataRate) MarshalJSON() ([]byte, error)

func (DataRate) String

func (d DataRate) String() string

func (*DataRate) UnmarshalJSON

func (d *DataRate) UnmarshalJSON(data []byte) error

type MacAddress

type MacAddress [8]byte

func (MacAddress) MarshalJSON

func (m MacAddress) MarshalJSON() ([]byte, error)

func (MacAddress) String

func (m MacAddress) String() string

func (*MacAddress) UnmarshalJSON

func (m *MacAddress) UnmarshalJSON(data []byte) error

type Model

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

func New

func New(database db) *Model

type RxPacket

type RxPacket struct {
	GatewayMac MacAddress  `json:"gateway mac"`
	Time       CompactTime `json:"time"`
	Frequency  float64     `json:"frequency"`
	IFChannel  uint8       `json:"IF channel"`
	RFChain    uint8       `json:"RF chain"`
	Crc        int8        `json:"crc"`
	Modulation string      `json:"modulation"`
	DataR      DataRate    `json:"data rate"`
	CodingRate string      `json:"coding rate"`
	RSSI       int16       `json:"rssi"`
	SNR        float64     `json:"snr"`
	Size       uint16      `json:"size"`
	Data       string      `json:"data"`
}

Jump to

Keyboard shortcuts

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