objects

package
v3.10.5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceUplinkResponse

type DeviceUplinkResponse struct {
	Result ExtendedUplinkResponse `json:"result"`
	Error  string                 `json:"error"`
}

DeviceUplinkResponse contains the uplink response and the error if applicable.

type DeviceUplinkResponses

type DeviceUplinkResponses map[EUI]DeviceUplinkResponse

DeviceUplinkResponses maps the device EUIs to the DeviceUplinkResponse.

func (DeviceUplinkResponses) UnmarshalJSON

func (d DeviceUplinkResponses) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DeviceUplinks map[EUI]*LoRaUplink

DeviceUplinks maps device EUIs to LoRaUplink

func (DeviceUplinks) MarshalJSON

func (u DeviceUplinks) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type EUI

type EUI types.EUI64

EUI represents a dash-separated EUI64.

func (EUI) MarshalJSON

func (e EUI) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (EUI) String

func (e EUI) String() string

func (*EUI) UnmarshalJSON

func (e *EUI) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ExtendedUplinkResponse added in v3.10.1

type ExtendedUplinkResponse struct {
	UplinkResponse

	Raw *json.RawMessage
}

ExtendedUplinkResponse extends UplinkResponse with the raw JSON payload.

func (ExtendedUplinkResponse) MarshalJSON added in v3.10.1

func (r ExtendedUplinkResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. Note that the Raw representation takes precedence in the marshaling process, if it is available.

func (*ExtendedUplinkResponse) UnmarshalJSON added in v3.10.1

func (r *ExtendedUplinkResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Marshaler.

type Hex

type Hex []byte

Hex represents hex encoded bytes.

func (Hex) MarshalJSON

func (h Hex) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (Hex) String

func (h Hex) String() string

String implements fmt.Stringer.

func (*Hex) UnmarshalJSON

func (h *Hex) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements json.Unmarshaler.

type LoRaDnlink struct {
	Port    uint8 `json:"port"`
	Payload Hex   `json:"payload"`
}

LoRaDnlink is a specification for a modem device.

func (LoRaDnlink) Fields

func (u LoRaDnlink) Fields() map[string]interface{}

Fields implements log.Fielder.

type LoRaUplink struct {
	Type LoRaUplinkType `json:"msgtype"`

	FCnt        *uint32  `json:"fcnt,omitempty"`
	Port        *uint8   `json:"port,omitempty"`
	Payload     *Hex     `json:"payload,omitempty"`
	DR          *uint8   `json:"dr,omitempty"`
	Freq        *uint32  `json:"freq,omitempty"`
	Timestamp   *float64 `json:"timestamp,omitempty"`
	DownlinkMTU *uint32  `json:"dn_mtu,omitempty"`

	GNSSCaptureTime         *float64  `json:"gnss_capture_time,omitempty"`
	GNSSCaptureTimeAccuracy *float64  `json:"gnss_capture_time_accuracy,omitempty"`
	GNSSAssistPosition      []float64 `json:"gnss_assist_position,omitempty"`
	GNSSAssistAltitude      *float64  `json:"gnss_assist_altitude,omitempty"`
	GNSSUse2DSolver         *bool     `json:"gnss_use_2D_solver,omitempty"`
}

LoRaUplink encapsulates the information of a LoRa message.

type LoRaUplinkType added in v3.9.0

type LoRaUplinkType uint8

LoRaUplinkType is the type of a LoRaCloud DMS uplink.

const (
	// UplinkUplinkType is LoRaWAN Message Type.
	UplinkUplinkType LoRaUplinkType = iota
	// ModemUplinkType is DMS Protocol Message Type.
	ModemUplinkType
	// JoiningUplinkType is Session Reset Message Type.
	JoiningUplinkType
	// GNSSUplinkType is DMS GNSS Message Type.
	GNSSUplinkType
	// WiFiUplinkType is DMS WiFi Message Type.
	WiFiUplinkType
	// UnknownUplinkType is used when the uplink type is unknown.
	UnknownUplinkType
)

func (LoRaUplinkType) MarshalJSON added in v3.9.0

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

MarshalJSON implements the json.Marshaler interface.

func (*LoRaUplinkType) UnmarshalJSON added in v3.9.0

func (t *LoRaUplinkType) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unarmshaler.

type PositionSolution added in v3.9.0

type PositionSolution struct {
	Algorithm PositionSolutionType `json:"algorithm_type"`
	LLH       []float64            `json:"llh"`
	Accuracy  float64              `json:"accuracy"`
}

PositionSolution is the result of a position query.

type PositionSolutionType added in v3.10.4

type PositionSolutionType uint8

PositionSolutionType is the algorithm used by a position solution query.

const (
	// GNSSPositionSolutionType is GNSS position solution type.
	GNSSPositionSolutionType PositionSolutionType = iota
	// WiFiPositionSolutionType is WiFi position solution type.
	WiFiPositionSolutionType
	// UnknownPositionSolutionType is used when the position solution type is unknown.
	UnknownPositionSolutionType
)

func (PositionSolutionType) MarshalJSON added in v3.10.4

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

MarshalJSON implements the json.Marshaler interface.

func (PositionSolutionType) String added in v3.10.4

func (t PositionSolutionType) String() string

String implements fmt.Stringer.

func (*PositionSolutionType) UnmarshalJSON added in v3.10.4

func (t *PositionSolutionType) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unarmshaler.

type StreamRecord added in v3.10.4

type StreamRecord struct {
	Offset uint32
	Data   Hex
}

StreamRecord contains the offset and the data of a fully reconstructed stream frame.

func (StreamRecord) MarshalJSON added in v3.10.4

func (r StreamRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*StreamRecord) UnmarshalJSON added in v3.10.4

func (r *StreamRecord) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Marshaler.

type UplinkResponse

type UplinkResponse struct {
	Downlink      *LoRaDnlink       `json:"dnlink"`
	StreamRecords []StreamRecord    `json:"stream_records"`
	Position      *PositionSolution `json:"position_solution"`
}

UplinkResponse contains the state changes and completed items due to an uplink message.

Jump to

Keyboard shortcuts

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