das

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a LoRa Cloud DAS client.

func New

func New(uri string, token string) *Client

New creates a new DAS client.

func (*Client) UplinkSend

func (c *Client) UplinkSend(ctx context.Context, req UplinkRequest) (UplinkResponse, error)

UplinkSend request.

type LoRaDownlink struct {
	Port    uint8            `json:"port"`
	Payload helpers.HEXBytes `json:"payload"`
}

LoRaDownlink implements the LoRa Cloud LoRaDownlink object.

type PositionSolution

type PositionSolution struct {
	ECEF           []float64 `json:"ecef"`
	LLH            []float64 `json:"llh"`
	CaptureTimeGPS float64   `json:"capture_time_gps"`
	GDOP           float64   `json:"gdop"`
	Accuracy       float64   `json:"accuracy"`
	Timestamp      float64   `json:"timestamp"`
}

PositionSolution implements the Positition Solution object.

type StreamUpdate

type StreamUpdate [][]interface{}

StreamUpdate lists both the signals and the fully-assembled streaming records that are received by the decoder. Each entry denotes an assembled packet with application data and record offset.

type UplinkDeviceMapResponse

type UplinkDeviceMapResponse map[helpers.EUI64]UplinkResponseItem

UplinkDeviceMapResponse implements the LoRa Cloud uplink/send respone per DevEUI.

type UplinkMsg

type UplinkMsg struct {
	MsgType   string  `json:"msgtype"` // Must be set to "updf"
	FCnt      uint32  `json:"fcnt"`
	Port      uint8   `json:"port"`
	DR        uint8   `json:"dr"`
	Freq      uint32  `json:"freq"`
	Timestamp float64 `json:"timestamp"` // Seconds since UTC
	Payload   string  `json:"payload"`   // Leave this blank
}

UplinkMsg implements the LoRa Cloud UplinkMsg object. The purpose of this message is to create a downlink opportunity for LoRa Cloud.

type UplinkMsgGNSS

type UplinkMsgGNSS struct {
	MsgType                 string           `json:"msgtype"` // Must be set to "gnss"
	Payload                 helpers.HEXBytes `json:"payload"`
	Timestamp               float64          `json:"timestamp"`                            // Seconds since UTC
	GNSSCaptureTime         float64          `json:"gnss_capture_time,omitempty"`          // GPS time
	GNSSCaptureTimeAccuracy float64          `json:"gnss_capture_time_accuracy,omitempty"` // seconds
	GNSSAssistPosition      []float64        `json:"gnss_assist_position,omitempty"`
	GNSSAssistAltitude      float64          `json:"gnss_assist_altitude,omitempty"`
	GNSSUse2DSolver         bool             `json:"gnss_use_2D_solver,omitempty"`
}

UplinkMsgGNSS implements the LoRa Cloud UplinkMsg object containing a gnss payload.

type UplinkMsgJoining

type UplinkMsgJoining struct {
	MsgType   string  `json:"msgtype"`   // Must be set to "joining"
	Timestamp float64 `json:"timestamp"` // Seconds since UTC
	DR        uint8   `json:"dr"`
	Freq      uint32  `json:"freq"`
}

UplinkMsgJoining implements the LoRa Cloud UplinkMsg object indicating a session reset.

type UplinkMsgModem

type UplinkMsgModem struct {
	MsgType   string           `json:"msgtype"` // Must be set to "modem"
	Payload   helpers.HEXBytes `json:"payload"`
	FCnt      uint32           `json:"fcnt"`
	Timestamp float64          `json:"timestamp"` // Seconds since UTC
	DR        uint8            `json:"dr"`
	Freq      uint32           `json:"freq"`
}

UplinkMsgModem implements the LoRa Cloud UplinkMsg object containing a modem payload.

type UplinkRequest

type UplinkRequest map[helpers.EUI64]interface{} // UplinkMsg || UplinkMsgModem || UplinkMsgJoining

UplinkRequest implements the LoRa Cloud uplink/send request.

type UplinkResponse

type UplinkResponse struct {
	Result UplinkDeviceMapResponse `json:"result"`
}

UplinkResponse implements the LoRa Cloud uplink/send response.

type UplinkResponseItem

type UplinkResponseItem struct {
	Result UplinkResponseResult `json:"result"`
	Error  string               `json:"error"`
}

UplinkResponseItem holds the response for a single DevEUI.

type UplinkResponseResult

type UplinkResponseResult struct {
	File              interface{}       `json:"file"`
	StreamRecords     StreamUpdate      `json:"stream_records"`
	PositionSolution  *PositionSolution `json:"position_solution"`
	FulfilledRequests interface{}       `json:"fulfilled_requests"`
	FPorts            interface{}       `json:"fports"`
	InfoFields        interface{}       `json:"info_fields"`
	PendingRequests   interface{}       `json:"pending_requests"`
	LogMessages       interface{}       `json:"log_messages"`
	Downlink          *LoRaDownlink     `json:"dnlink"`
}

UplinkResponseResult holds the response result.

Jump to

Keyboard shortcuts

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